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

优化权限校验

parent 375678e3
......@@ -70,8 +70,13 @@ export function patchRoutes({ routes }: IRoutes) {
* @export
*/
export function render(oldRender: Function) {
const { pathname } = history.location
// 白名单页面不进行权限校验
if (whiteLists.includes(pathname)) {
oldRender()
return ;
}
const authInfo = getAuth()
if (authInfo) {
PublicApi.getMemberLoginReget().then(res => {
const { data, code } = res
......@@ -81,7 +86,7 @@ export function render(oldRender: Function) {
} else {
removeAuth()
removeRouters()
history.push('/user/login')
history.replace('/user/login')
}
oldRender()
......
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