This commit is contained in:
parent
13160e4954
commit
dc3e05e241
|
@ -71,27 +71,27 @@ function getCookie(cname) {
|
|||
// return ''
|
||||
}
|
||||
|
||||
// router.beforeEach((to, form, next) => {
|
||||
// var token = getCookie('lytoken')
|
||||
// console.log('token', token)
|
||||
// if (token == '') {
|
||||
// window.location.href =
|
||||
// 'http://220.191.238.50:996/api/login?returnURL=' +
|
||||
// window.location.href
|
||||
// } else {
|
||||
// // http.get("/api/zzdn_event/auditToken?token=" + token).then((res) => {
|
||||
// // if (res.code == '500') {
|
||||
// // window.location.href =
|
||||
// // 'http://220.191.238.50:996/api/login?returnURL=' +
|
||||
// // window.location.href
|
||||
// // } else {
|
||||
// // tools.data.set('token',token)
|
||||
// // next();
|
||||
// // }
|
||||
// // });
|
||||
// tools.data.set('token', token)
|
||||
// next();
|
||||
// }
|
||||
// })
|
||||
router.beforeEach((to, form, next) => {
|
||||
var token = getCookie('lytoken')
|
||||
console.log('token', token)
|
||||
if (token == '') {
|
||||
window.location.href =
|
||||
'http://220.191.238.50:996/api/login?returnURL=' +
|
||||
window.location.href
|
||||
} else {
|
||||
// http.get("/api/zzdn_event/auditToken?token=" + token).then((res) => {
|
||||
// if (res.code == '500') {
|
||||
// window.location.href =
|
||||
// 'http://220.191.238.50:996/api/login?returnURL=' +
|
||||
// window.location.href
|
||||
// } else {
|
||||
// tools.data.set('token',token)
|
||||
// next();
|
||||
// }
|
||||
// });
|
||||
tools.data.set('token', token)
|
||||
next();
|
||||
}
|
||||
})
|
||||
|
||||
export default router
|
|
@ -30,9 +30,9 @@ axios.interceptors.response.use(
|
|||
if (error.response.status == 401) {
|
||||
ElMessage.error("请重新登录!");
|
||||
// window.location.href = '/#/login?returnURL=' + window.location.href
|
||||
// window.location.href =
|
||||
// 'http://220.191.238.50:996/api/login?returnURL=' +
|
||||
// window.location.href
|
||||
window.location.href =
|
||||
'http://220.191.238.50:996/api/login?returnURL=' +
|
||||
window.location.href
|
||||
} else if (error.response.status == 404) {
|
||||
ElMessage.error("Status:404,正在请求不存在的服务器记录!");
|
||||
} else if (error.response.status == 500) {
|
||||
|
|
Loading…
Reference in New Issue