Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jinfa-platform
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
陈智峰
jinfa-platform
Commits
a2324299
Commit
a2324299
authored
Dec 11, 2020
by
前端-许佳敏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 无首页权限时,只要登录了 就能进入
parent
13b268f1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
14 deletions
+11
-14
app.tsx
src/app.tsx
+10
-13
index.ts
src/constants/index.ts
+1
-1
No files found.
src/app.tsx
View file @
a2324299
...
...
@@ -97,6 +97,10 @@ const whiteLists = [
'/noAuth'
]
// 登录后的路由白名单
const
loginWhiteList
=
[
'/memberCenter/home'
]
/**
* @description 配置函数,对已配置的路由做修改, 一般与render函数一起结合可根据接口动态配置路由, 直接修改routes即可
* @author xjm
...
...
@@ -171,7 +175,7 @@ export function onRouteChange({ routes, matchedRoutes, location, action }) {
},
'menu'
)
recent
.
put
(
breadCrumb
,
location
.
pathname
+
location
.
search
);
}
if
(
isDev
)
{
return
;
}
...
...
@@ -179,6 +183,7 @@ export function onRouteChange({ routes, matchedRoutes, location, action }) {
if
(
whiteLists
.
includes
(
location
.
pathname
))
{
return
}
const
authInfo
=
getAuth
()
// 是否登录
if
(
authInfo
)
{
...
...
@@ -197,18 +202,10 @@ export function onRouteChange({ routes, matchedRoutes, location, action }) {
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
(
loginWhiteList
.
includes
(
location
.
pathname
))
{
return
}
// 是否在路由权限列表里
if
(
routeAuthUrls
.
includes
(
pathname
))
{
return
;
...
...
src/constants/index.ts
View file @
a2324299
...
...
@@ -1765,5 +1765,5 @@ export const RETURN_OUTER_STATUS = {
[
RETURN_OUTER_STATUS_UNCONFIRMED_REFUNDED
]:
'待确认退款'
,
[
RETURN_OUTER_STATUS_NOT_RECEIVED
]:
'确认退款未到账'
,
[
RETURN_OUTER_STATUS_UNCONFIRMED_FINISHED
]:
'待确认售后完成'
,
[
RETURN_OUTER_STATUS_FINISHED
]:
'售后完成'
,
[
RETURN_OUTER_STATUS_FINISHED
]:
'售后完成'
,
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment