|
|
@ -18,7 +18,7 @@ if(isKd){ |
|
|
|
host = 'http://124.71.12.62:9000'; // 巢湖版
|
|
|
|
host = 'http://124.71.12.62:9000'; // 巢湖版
|
|
|
|
} else if (dev) { |
|
|
|
} else if (dev) { |
|
|
|
host = 'http://121.37.12.51'; |
|
|
|
host = 'http://121.37.12.51'; |
|
|
|
host = 'http://192.168.31.217:9000'; |
|
|
|
// host = 'http://192.168.31.217:9000';
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -35,10 +35,9 @@ service.defaults.headers.post['Content-Type'] = 'application/json;charset=UTF-8' |
|
|
|
|
|
|
|
|
|
|
|
// 请求拦截器
|
|
|
|
// 请求拦截器
|
|
|
|
service.interceptors.request.use(config => { |
|
|
|
service.interceptors.request.use(config => { |
|
|
|
// if (sessionStorage.getItem('token')) {
|
|
|
|
// 存在将token写入 request header
|
|
|
|
// 存在将token写入 request header
|
|
|
|
const { token } = router.currentRoute.query |
|
|
|
config.headers.token = store.state.token |
|
|
|
config.headers.token = token ? atob(decodeURI(token)) : localStorage.getItem('token') |
|
|
|
// }
|
|
|
|
|
|
|
|
return config; |
|
|
|
return config; |
|
|
|
}, err => { |
|
|
|
}, err => { |
|
|
|
Message.error({ |
|
|
|
Message.error({ |
|
|
@ -106,7 +105,11 @@ function logouts(){ |
|
|
|
let referrer = store.state.referrer |
|
|
|
let referrer = store.state.referrer |
|
|
|
store.replaceState({}) |
|
|
|
store.replaceState({}) |
|
|
|
sessionStorage.removeItem('kd_client_username') |
|
|
|
sessionStorage.removeItem('kd_client_username') |
|
|
|
location.href = referrer |
|
|
|
if (referrer) { |
|
|
|
|
|
|
|
location.href = referrer |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
window.history.back() |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
let tokenStatus = { |
|
|
|
let tokenStatus = { |
|
|
|
0: '用户未登录,请登录后操作!', |
|
|
|
0: '用户未登录,请登录后操作!', |
|
|
|