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
dec0d391
Commit
dec0d391
authored
Nov 05, 2022
by
shenshaokai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 登录后菜单权限问题
parent
4d498995
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
7 deletions
+12
-7
app.tsx
src/app.tsx
+12
-7
No files found.
src/app.tsx
View file @
dec0d391
...
...
@@ -100,7 +100,7 @@ export function patchRoutes({ routes }: IRoutes) {
export
async
function
render
(
oldRender
:
Function
)
{
const
{
pathname
}
=
history
.
location
if
(
pathname
===
'/'
)
{
if
(
pathname
===
'/'
)
{
history
.
replace
(
defaultHomePath
())
}
// 白名单页面不进行权限校验
...
...
@@ -110,9 +110,8 @@ export async function render(oldRender: Function) {
}
const
authInfo
=
getAuth
()
if
(
authInfo
)
{
getMemberLoginReget
({},
{
useCache
:
true
,
ttl
:
1000
}).
then
(
res
=>
{
const
{
data
,
code
}
=
res
console
.
log
(
"getMemberLoginReget---->"
,
res
)
try
{
const
{
data
,
code
}
=
await
getMemberLoginReget
({},
{
useCache
:
true
,
ttl
:
1000
})
if
(
code
===
1000
)
{
setAuth
(
data
as
any
)
setRouters
(
data
.
auth
)
...
...
@@ -122,7 +121,13 @@ export async function render(oldRender: Function) {
history
.
replace
(
'/user/login'
)
SpaLogin
()
}
})
}
catch
(
error
)
{
removeAuth
()
removeRouters
()
history
.
replace
(
'/user/login'
)
SpaLogin
()
}
// const resReget = await getMemberLoginReget({}, { useCache: true, ttl: 1000 })
// if (resReget.code === 1000) {
// setAuth(resReget.data as any)
...
...
@@ -159,14 +164,14 @@ export async function render(oldRender: Function) {
// @description 获取权限列表 实时控制菜单访问权限
const
resAuth
:
any
=
getResAuth
||
await
getMemberAuthList
({})
sessionStorage
.
setItem
(
'ls-auth'
,
JSON
.
stringify
(
resAuth
))
if
(
resAuth
.
code
===
1000
)
{
if
(
resAuth
.
code
===
1000
)
{
realTimeAuthLists
=
resAuth
.
data
oldRender
()
}
else
{
removeLogin
()
return
message
.
error
(
resAuth
.
message
)
}
}
catch
(
err
)
{
}
catch
(
err
)
{
console
.
log
(
err
)
}
...
...
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