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
301a4d93
Commit
301a4d93
authored
Jan 18, 2022
by
GuanHua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修改当前角色类型显示的问题
parent
338342cb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
Roles.tsx
src/layouts/components/Roles.tsx
+4
-3
No files found.
src/layouts/components/Roles.tsx
View file @
301a4d93
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
{
Dropdown
,
Space
,
Menu
,
message
}
from
'antd'
;
import
{
Dropdown
,
Space
,
Menu
,
message
}
from
'antd'
;
import
{
CaretDownOutlined
}
from
'@ant-design/icons'
;
import
{
CaretDownOutlined
}
from
'@ant-design/icons'
;
import
{
getAuth
,
setAuth
,
setRouters
}
from
'@/utils/auth'
;
import
{
getAuth
,
getCookieAuth
,
setAuth
,
setRouters
}
from
'@/utils/auth'
;
import
{
postMemberLoginSwitchrole
}
from
'@/services/MemberV2Api'
;
import
{
postMemberLoginSwitchrole
}
from
'@/services/MemberV2Api'
;
import
{
useIntl
}
from
'umi'
import
{
useIntl
}
from
'umi'
...
@@ -17,12 +17,13 @@ const Roles: React.FC = () => {
...
@@ -17,12 +17,13 @@ const Roles: React.FC = () => {
const
[
roles
,
setRoles
]
=
useState
<
MemberRole
[]
>
([]);
const
[
roles
,
setRoles
]
=
useState
<
MemberRole
[]
>
([]);
useEffect
(()
=>
{
useEffect
(()
=>
{
const
userInfo
=
getAuth
()
||
{};
const
userInfo
:
any
=
getAuth
()
||
{};
const
cookieUserInfo
:
any
=
getCookieAuth
()
||
{}
console
.
log
(
userInfo
,
10086
)
console
.
log
(
userInfo
,
10086
)
setRoles
(
userInfo
.
roles
||
[]);
setRoles
(
userInfo
.
roles
||
[]);
if
(
userInfo
.
roles
&&
userInfo
.
roles
.
length
)
{
if
(
userInfo
.
roles
&&
userInfo
.
roles
.
length
)
{
const
current
=
userInfo
.
roles
.
find
(
item
=>
item
.
memberRoleId
===
u
serInfo
.
memberRoleId
);
const
current
=
userInfo
.
roles
.
find
(
item
=>
item
.
memberRoleId
===
cookieU
serInfo
.
memberRoleId
);
setCurRole
(
current
);
setCurRole
(
current
);
}
}
},
[]);
},
[]);
...
...
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