| | |
| | | export let isRelogin = { show: false }; |
| | | |
| | | axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8' |
| | | // 对应国际化资源文件后缀 |
| | | axios.defaults.headers['Content-Language'] = 'zh_CN' |
| | | // 创建axios实例 |
| | | const service = axios.create({ |
| | | // axios中请求配置有baseURL选项,表示请求URL公共部分 |
| | |
| | | ).then(() => { |
| | | isRelogin.show = false; |
| | | store.dispatch('LogOut').then(() => { |
| | | location.href = '/index'; |
| | | location.href = process.env.VUE_APP_CONTEXT_PATH + "index"; |
| | | }) |
| | | }).catch(() => { |
| | | isRelogin.show = false; |
| | |
| | | type: 'error' |
| | | }) |
| | | return Promise.reject(new Error(msg)) |
| | | } else if (code === 601) { |
| | | Message({ |
| | | message: msg, |
| | | type: 'warning' |
| | | }) |
| | | return Promise.reject('error') |
| | | } else if (code !== 200) { |
| | | Notification.error({ |
| | | title: msg |