Commit a01277af authored by 前端-许佳敏's avatar 前端-许佳敏

fix:去掉无用权限判断

parent 0d5fced6
......@@ -170,28 +170,31 @@ export function onRouteChange({ routes, matchedRoutes, location, action }) {
if (getAuth()) {
const routeAuthUrls = getRouters()
const { query, pathname } = location
const { pathname } = location
if (userLoginLists.includes(pathname)) {
// 当登录过, 并且尝试访问登录相关页面, 需重定向到首页
history.replace('/memberCenter/home')
return;
}
// 固定配置, 出现此参数说明需携带参数校验权限路由
if (query.page_type && routeAuthUrls.find(authPath => {
const parseUrl = queryString.parseUrl(authPath)
const { query: selfQuery, url } = parseUrl
// 当页面出现参数page_type时, 需进入深度校验, 即对应的参数和路径匹配
return url === pathname && selfQuery.page_type === query.page_type
})) {
// 深度匹配成功, 可正常访问
return;
}
// 去掉page_type参数校验, 无需根据query参数判断权限
// // 固定配置, 出现此参数说明需携带参数校验权限路由
// if (query.page_type && routeAuthUrls.find(authPath => {
// const parseUrl = queryString.parseUrl(authPath)
// const { query: selfQuery, url } = parseUrl
// // 当页面出现参数page_type时, 需进入深度校验, 即对应的参数和路径匹配
// return url === pathname && selfQuery.page_type === query.page_type
// })) {
// // 深度匹配成功, 可正常访问
// return;
// }
// 是否在路由权限列表里
if (routeAuthUrls.includes(pathname)) {
return;
}
// 无权限访问时
console.log(pathname)
history.replace('/memberCenter/noAuth')
} else {
if (whiteLists.includes(location.pathname)) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment