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
shenshaokai
jinfa-platform
Commits
38c6d146
Commit
38c6d146
authored
Aug 18, 2020
by
前端-许佳敏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复从登录页首次进入无路由信息
parent
cc7de3c4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
app.tsx
src/app.tsx
+5
-5
LoginWrap.tsx
src/pages/user/components/LoginWrap.tsx
+1
-1
No files found.
src/app.tsx
View file @
38c6d146
...
...
@@ -70,10 +70,12 @@ export function render(oldRender: Function) {
token
:
data
.
token
})
setRouters
(
data
.
urls
)
oldRender
()
})
}
else
{
history
.
push
(
'/user/login'
)
oldRender
()
}
oldRender
()
}
/**
...
...
@@ -84,15 +86,13 @@ export function render(oldRender: Function) {
* @param {*} { routes, matchedRoutes, location, action }
*/
export
function
onRouteChange
({
routes
,
matchedRoutes
,
location
,
action
})
{
console
.
log
(
`当前可访问的路由为`
)
console
.
log
(
routes
,
matchedRoutes
,
location
)
console
.
log
(
'onRouteChange'
)
if
(
isDev
)
{
return
;
}
if
(
whiteLists
.
includes
(
location
.
pathname
))
return
;
const
routeAuthUrls
=
getRouters
()
console
.
log
(
routeAuthUrls
,
"routeAuthUrls"
)
// 是否登录
if
(
getAuth
())
{
if
(
routeAuthUrls
.
includes
(
location
.
pathname
))
{
...
...
src/pages/user/components/LoginWrap.tsx
View file @
38c6d146
...
...
@@ -23,7 +23,7 @@ const LoginWrap: React.FC = () => {
token
:
data
.
token
})
setRouters
(
data
.
urls
)
history
.
push
(
'/memberCenter/home'
)
window
.
location
.
href
=
'/memberCenter/home'
})
}
...
...
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