去除部分调试日志以及恢复代码
This commit is contained in:
parent
9117294d0a
commit
e11f60fb60
@ -21,7 +21,6 @@ export default {
|
|||||||
created() {
|
created() {
|
||||||
if(!this.$cookies.get("session")){
|
if(!this.$cookies.get("session")){
|
||||||
//如果没有登录状态则跳转到登录页
|
//如果没有登录状态则跳转到登录页
|
||||||
console.log("33333333")
|
|
||||||
this.$router.push('/login');
|
this.$router.push('/login');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -43,7 +42,6 @@ export default {
|
|||||||
//cookie操作方法在源码里有或者参考网上的即可
|
//cookie操作方法在源码里有或者参考网上的即可
|
||||||
if(!this.$cookies.get("session")){
|
if(!this.$cookies.get("session")){
|
||||||
//如果没有登录状态则跳转到登录页
|
//如果没有登录状态则跳转到登录页
|
||||||
console.log("222222222")
|
|
||||||
this.$router.push('/login');
|
this.$router.push('/login');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -41,17 +41,17 @@ Vue.prototype.$notify = Notification;
|
|||||||
axios.defaults.baseURL = (process.env.NODE_ENV === 'development') ? process.env.BASE_API : "";
|
axios.defaults.baseURL = (process.env.NODE_ENV === 'development') ? process.env.BASE_API : "";
|
||||||
|
|
||||||
// api 返回401自动回登陆页面
|
// api 返回401自动回登陆页面
|
||||||
// axios.interceptors.response.use(function (response) {
|
axios.interceptors.response.use(function (response) {
|
||||||
// // 对响应数据做点什么
|
// 对响应数据做点什么
|
||||||
// return response;
|
return response;
|
||||||
// }, function (error) {
|
}, function (error) {
|
||||||
// // 对响应错误做点什么
|
// 对响应错误做点什么
|
||||||
// if (error.response.status === 401) {
|
if (error.response.status === 401) {
|
||||||
// console.log((1111))
|
console.log((1111))
|
||||||
// router.push('/login');
|
router.push('/login');
|
||||||
// }
|
}
|
||||||
// return Promise.reject(error);
|
return Promise.reject(error);
|
||||||
// });
|
});
|
||||||
|
|
||||||
Vue.prototype.$cookies.config(60*30);
|
Vue.prototype.$cookies.config(60*30);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user