| | |
| | | import cache from '@/plugins/cache' |
| | | import { saveAs } from 'file-saver' |
| | | |
| | | const JSONBig = require('json-bigint')({ "storeAsString": true }); |
| | | let downloadLoadingInstance; |
| | | // 是否显示重新登录 |
| | | export let isRelogin = { show: false }; |
| | |
| | | // axios中请求配置有baseURL选项,表示请求URL公共部分 |
| | | baseURL: process.env.VUE_APP_BASE_API, |
| | | // 超时 |
| | | timeout: 60000 |
| | | timeout: 60000, |
| | | transformResponse: [ |
| | | function (data) { |
| | | // 对 data 进行任意转换处理 |
| | | try { |
| | | return JSONBig.parse(data) |
| | | } catch (err) { |
| | | return data |
| | | } |
| | | } |
| | | ] |
| | | }) |
| | | |
| | | // request拦截器 |
| | |
| | | MessageBox.confirm('登录状态已过期,您可以继续留在该页面,或者重新登录', '系统提示', { confirmButtonText: '重新登录', cancelButtonText: '取消', type: 'warning' }).then(() => { |
| | | isRelogin.show = false; |
| | | store.dispatch('LogOut').then(() => { |
| | | // location.href = '/index'; |
| | | let indexUrl = this.$store.state.permission.indexPage |
| | | location.href = indexUrl; |
| | | // let indexUrl = this.$store.state.permission.indexPage |
| | | location.href = '/index'; |
| | | }) |
| | | }).catch(() => { |
| | | isRelogin.show = false; |