Merge branch 'main' of git.zdool.com:xs/ggfwjsc
This commit is contained in:
commit
c83d44e306
|
@ -71,27 +71,27 @@ function getCookie(cname) {
|
||||||
// return ''
|
// return ''
|
||||||
}
|
}
|
||||||
|
|
||||||
// router.beforeEach((to, form, next) => {
|
router.beforeEach((to, form, next) => {
|
||||||
// var token = getCookie('lytoken')
|
var token = getCookie('lytoken')
|
||||||
// console.log('token',token)
|
console.log('token', token)
|
||||||
// if (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 =
|
// window.location.href =
|
||||||
// 'http://220.191.238.50:996/api/login?returnURL=' +
|
// 'http://220.191.238.50:996/api/login?returnURL=' +
|
||||||
// window.location.href
|
// window.location.href
|
||||||
// } else {
|
// } 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)
|
// tools.data.set('token',token)
|
||||||
// next();
|
// next();
|
||||||
// }
|
// }
|
||||||
// })
|
// });
|
||||||
|
tools.data.set('token', token)
|
||||||
|
next();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
export default router
|
export default router
|
|
@ -11,7 +11,7 @@ axios.interceptors.request.use(
|
||||||
(config) => {
|
(config) => {
|
||||||
let token = tools.data.get('token');
|
let token = tools.data.get('token');
|
||||||
if (token) {
|
if (token) {
|
||||||
config.headers['X-USER-TOKEN'] = token.token
|
config.headers['x-token'] = token
|
||||||
}
|
}
|
||||||
return config;
|
return config;
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue