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

fix: 无首页权限时,只要登录了 就能进入

parent 13b268f1
...@@ -97,6 +97,10 @@ const whiteLists = [ ...@@ -97,6 +97,10 @@ const whiteLists = [
'/noAuth' '/noAuth'
] ]
// 登录后的路由白名单
const loginWhiteList = [
'/memberCenter/home'
]
/** /**
* @description 配置函数,对已配置的路由做修改, 一般与render函数一起结合可根据接口动态配置路由, 直接修改routes即可 * @description 配置函数,对已配置的路由做修改, 一般与render函数一起结合可根据接口动态配置路由, 直接修改routes即可
* @author xjm * @author xjm
...@@ -171,7 +175,7 @@ export function onRouteChange({ routes, matchedRoutes, location, action }) { ...@@ -171,7 +175,7 @@ export function onRouteChange({ routes, matchedRoutes, location, action }) {
}, 'menu') }, 'menu')
recent.put(breadCrumb, location.pathname + location.search); recent.put(breadCrumb, location.pathname + location.search);
} }
if (isDev) { if (isDev) {
return; return;
} }
...@@ -179,6 +183,7 @@ export function onRouteChange({ routes, matchedRoutes, location, action }) { ...@@ -179,6 +183,7 @@ export function onRouteChange({ routes, matchedRoutes, location, action }) {
if (whiteLists.includes(location.pathname)) { if (whiteLists.includes(location.pathname)) {
return return
} }
const authInfo = getAuth() const authInfo = getAuth()
// 是否登录 // 是否登录
if (authInfo) { if (authInfo) {
...@@ -197,18 +202,10 @@ export function onRouteChange({ routes, matchedRoutes, location, action }) { ...@@ -197,18 +202,10 @@ export function onRouteChange({ routes, matchedRoutes, location, action }) {
return; return;
} }
// 去掉page_type参数校验, 无需根据query参数判断权限 // 登录之后 能力中心的首页应该变为可以访问, 无论是否在权限中
if (loginWhiteList.includes(location.pathname)) {
// // 固定配置, 出现此参数说明需携带参数校验权限路由 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;
// }
// 是否在路由权限列表里 // 是否在路由权限列表里
if (routeAuthUrls.includes(pathname)) { if (routeAuthUrls.includes(pathname)) {
return; return;
......
...@@ -1765,5 +1765,5 @@ export const RETURN_OUTER_STATUS = { ...@@ -1765,5 +1765,5 @@ export const RETURN_OUTER_STATUS = {
[RETURN_OUTER_STATUS_UNCONFIRMED_REFUNDED]: '待确认退款', [RETURN_OUTER_STATUS_UNCONFIRMED_REFUNDED]: '待确认退款',
[RETURN_OUTER_STATUS_NOT_RECEIVED]: '确认退款未到账', [RETURN_OUTER_STATUS_NOT_RECEIVED]: '确认退款未到账',
[RETURN_OUTER_STATUS_UNCONFIRMED_FINISHED]: '待确认售后完成', [RETURN_OUTER_STATUS_UNCONFIRMED_FINISHED]: '待确认售后完成',
[RETURN_OUTER_STATUS_FINISHED]: '售后完成', [RETURN_OUTER_STATUS_FINISHED]: '售后完成',
} }
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