Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
performance
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zry
performance
Commits
5b92c91c
Commit
5b92c91c
authored
Apr 22, 2021
by
钟博
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
切换角色token空值补全
parent
15c8d8a6
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
+10
-10
performance/Performance.Api/Controllers/AccountController.cs
+10
-10
No files found.
performance/Performance.Api/Controllers/AccountController.cs
View file @
5b92c91c
...
...
@@ -92,13 +92,13 @@ public ApiResponse<JwtToken> Refresh()
var
userClaim
=
_claim
.
GetUserClaim
();
var
claims
=
new
Claim
[]
{
new
Claim
(
JwtClaimTypes
.
Id
,
userClaim
.
FirstOrDefault
(
t
=>
t
.
Type
==
JwtClaimTypes
.
Id
)
.
Value
),
new
Claim
(
JwtClaimTypes
.
Login
,
userClaim
.
FirstOrDefault
(
t
=>
t
.
Type
==
JwtClaimTypes
.
Login
)
.
Value
),
new
Claim
(
JwtClaimTypes
.
RealName
,
userClaim
.
FirstOrDefault
(
t
=>
t
.
Type
==
JwtClaimTypes
.
RealName
)
.
Value
),
new
Claim
(
JwtClaimTypes
.
Mail
,
userClaim
.
FirstOrDefault
(
t
=>
t
.
Type
==
JwtClaimTypes
.
Mail
)
.
Value
),
new
Claim
(
JwtClaimTypes
.
AppName
,
userClaim
.
FirstOrDefault
(
t
=>
t
.
Type
==
JwtClaimTypes
.
AppName
)
.
Value
),
new
Claim
(
JwtClaimTypes
.
Device
,
userClaim
.
FirstOrDefault
(
t
=>
t
.
Type
==
JwtClaimTypes
.
Device
)
.
Value
),
new
Claim
(
JwtClaimTypes
.
Department
,
userClaim
.
FirstOrDefault
(
t
=>
t
.
Type
==
JwtClaimTypes
.
Department
)
.
Value
),
new
Claim
(
JwtClaimTypes
.
Id
,
userClaim
.
FirstOrDefault
(
t
=>
t
.
Type
==
JwtClaimTypes
.
Id
)
?.
Value
??
""
),
new
Claim
(
JwtClaimTypes
.
Login
,
userClaim
.
FirstOrDefault
(
t
=>
t
.
Type
==
JwtClaimTypes
.
Login
)
?.
Value
??
""
),
new
Claim
(
JwtClaimTypes
.
RealName
,
userClaim
.
FirstOrDefault
(
t
=>
t
.
Type
==
JwtClaimTypes
.
RealName
)
?.
Value
??
""
),
new
Claim
(
JwtClaimTypes
.
Mail
,
userClaim
.
FirstOrDefault
(
t
=>
t
.
Type
==
JwtClaimTypes
.
Mail
)
?.
Value
??
""
),
new
Claim
(
JwtClaimTypes
.
AppName
,
userClaim
.
FirstOrDefault
(
t
=>
t
.
Type
==
JwtClaimTypes
.
AppName
)
?.
Value
??
""
),
new
Claim
(
JwtClaimTypes
.
Device
,
userClaim
.
FirstOrDefault
(
t
=>
t
.
Type
==
JwtClaimTypes
.
Device
)
?.
Value
??
""
),
new
Claim
(
JwtClaimTypes
.
Department
,
userClaim
.
FirstOrDefault
(
t
=>
t
.
Type
==
JwtClaimTypes
.
Department
)
?.
Value
??
""
),
};
var
jwtToken
=
JwtTokenHelper
.
GenerateToken
(
claims
,
_options
.
ExpirationMinutes
);
...
...
@@ -271,9 +271,9 @@ public ApiResponse<JwtToken> DemoUsers(int userId)
new
Claim
(
JwtClaimTypes
.
Id
,
user
.
UserID
.
ToString
()),
new
Claim
(
JwtClaimTypes
.
Login
,
user
.
Login
),
new
Claim
(
JwtClaimTypes
.
RealName
,
user
.
RealName
),
new
Claim
(
JwtClaimTypes
.
Mail
,
user
.
Mail
),
new
Claim
(
JwtClaimTypes
.
AppName
,
userClaim
.
FirstOrDefault
(
t
=>
t
.
Type
==
JwtClaimTypes
.
AppName
)
.
Value
),
new
Claim
(
JwtClaimTypes
.
Device
,
userClaim
.
FirstOrDefault
(
t
=>
t
.
Type
==
JwtClaimTypes
.
Device
)
.
Value
),
new
Claim
(
JwtClaimTypes
.
Mail
,
user
.
Mail
??
""
),
new
Claim
(
JwtClaimTypes
.
AppName
,
userClaim
.
FirstOrDefault
(
t
=>
t
.
Type
==
JwtClaimTypes
.
AppName
)
?.
Value
??
""
),
new
Claim
(
JwtClaimTypes
.
Device
,
userClaim
.
FirstOrDefault
(
t
=>
t
.
Type
==
JwtClaimTypes
.
Device
)
?.
Value
??
""
),
new
Claim
(
JwtClaimTypes
.
Department
,
user
.
Department
??
""
),
};
...
...
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