This commit is contained in:
parent
6d3f4383e5
commit
fbd607447b
|
@ -52,9 +52,9 @@ const router = createRouter({
|
||||||
|
|
||||||
function getCookie(cname) {
|
function getCookie(cname) {
|
||||||
var cn = cname
|
var cn = cname
|
||||||
console.log('cname',cname)
|
console.log('cname', cname)
|
||||||
const cookies = document.cookie.split('; ');
|
const cookies = document.cookie.split('; ');
|
||||||
console.log('cookies',cookies)
|
console.log('cookies', cookies)
|
||||||
for (let i = 0; i < cookies.length; i++) {
|
for (let i = 0; i < cookies.length; i++) {
|
||||||
const [name, value] = cookies[i].split('=');
|
const [name, value] = cookies[i].split('=');
|
||||||
if (name === cn) {
|
if (name === cn) {
|
||||||
|
@ -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 =
|
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) => {
|
// http.get("/api/zzdn_event/auditToken?token=" + token).then((res) => {
|
||||||
// // if (res.code == '500') {
|
// 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 {
|
||||||
// // tools.data.set('token',token)
|
// tools.data.set('token',token)
|
||||||
// // next();
|
// next();
|
||||||
// // }
|
// }
|
||||||
// // });
|
// });
|
||||||
// tools.data.set('token',token)
|
tools.data.set('token', token)
|
||||||
// next();
|
next();
|
||||||
// }
|
}
|
||||||
// })
|
})
|
||||||
|
|
||||||
export default router
|
export default router
|
Loading…
Reference in New Issue