放开前端跳转权限校验

This commit is contained in:
Gao xiaosong
2021-04-18 16:27:19 +08:00
parent 0d98c8e778
commit 7817ac45d8

View File

@ -549,26 +549,32 @@ export const handleLoginStatus = (location, complete, fail, success) => {
} }
console.log(isAuth) console.log(isAuth)
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
if (isAuth) { resolve({
// 有token url: parseUrl(location),
if (path == '/pages/home/index' || path == '/pages/shop/GoodsClass/index' || path == '/pages/shop/ShoppingCart/index' || path == '/pages/user/User/index') { complete,
// switchTab({ fail,
// path: parseUrl(location), success,
// }) })
// return // if (isAuth) {
} // // 有token
// if (path == '/pages/home/index' || path == '/pages/shop/GoodsClass/index' || path == '/pages/shop/ShoppingCart/index' || path == '/pages/user/User/index') {
// // switchTab({
// // path: parseUrl(location),
// // })
// // return
// }
resolve({ // resolve({
url: parseUrl(location), // url: parseUrl(location),
complete, // complete,
fail, // fail,
success, // success,
}) // })
} else { // } else {
// 没有token先校验用户是否授权如果授权了进行自动登录 // // 没有token先校验用户是否授权如果授权了进行自动登录
routerPermissions(parseUrl(location)) // routerPermissions(parseUrl(location))
reject() // reject()
} // }
}).catch(error => { }).catch(error => {
console.log(error) console.log(error)
}) })