|
@@ -31,7 +31,7 @@ service.interceptors.response.use(
|
|
|
*/
|
|
|
|
|
|
const res = response.data
|
|
|
- console.log(res,'res')
|
|
|
+ console.log(window.location)
|
|
|
if (res.code !== 200) {
|
|
|
Message({
|
|
|
message: res.message,
|
|
@@ -41,7 +41,7 @@ service.interceptors.response.use(
|
|
|
|
|
|
// 401:未登录;
|
|
|
if (res.code === 401 || res.code === 403) {
|
|
|
- location = window.location.hostname;
|
|
|
+ location = window.location.origin;
|
|
|
// MessageBox.confirm('登录过期请重新登录', '确定登出', {
|
|
|
// confirmButtonText: '重新登录',
|
|
|
// cancelButtonText: '取消',
|
|
@@ -51,7 +51,7 @@ service.interceptors.response.use(
|
|
|
// // // location.reload()// 为了重新实例化vue-router对象 避免bug
|
|
|
// // location.href = window.location.hostname;
|
|
|
// // })
|
|
|
- // location.href = window.location.hostname;
|
|
|
+ location.replace(location.origin);
|
|
|
// })
|
|
|
}
|
|
|
return Promise.reject('error')
|