Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
data-center-auto
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
bltdc
data-center-auto
Commits
d70f8f38
Commit
d70f8f38
authored
Dec 26, 2020
by
泽锋 李
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
fef3ce9e
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
2 deletions
+4
-2
AutoUtility.cs
AutoTurnOver/Common/AutoUtility.cs
+2
-1
UserFilterAttribute.cs
AutoTurnOver/Models/UserFilterAttribute.cs
+2
-1
No files found.
AutoTurnOver/Common/AutoUtility.cs
View file @
d70f8f38
...
...
@@ -26,8 +26,9 @@ namespace AutoTurnOver.Common
var
tokenDecode
=
WebUtility
.
UrlDecode
(
token
);
var
dd
=
new
JwtSecurityToken
(
tokenDecode
.
Replace
(
"Bearer "
,
""
));
var
userId
=
dd
.
Claims
.
FirstOrDefault
(
m
=>
m
.
Type
==
"UserId"
).
Value
;
var
exp
=
dd
.
Claims
.
FirstOrDefault
(
m
=>
m
.
Type
==
"exp"
).
Value
;
var
userInfo
=
RedisHelper
.
Get
<
tokenUser
>(
"sso-aims-authorization-user-info-"
+
userId
,
()
=>
{
return
null
;
}).
result
;
var
userInfo
=
RedisHelper
.
Get
<
tokenUser
>(
"sso-aims-authorization-user-info-"
+
userId
+
"-"
+
exp
,
()
=>
{
return
null
;
}).
result
;
return
new
UserData
{
UserName
=
userInfo
.
Account
,
...
...
AutoTurnOver/Models/UserFilterAttribute.cs
View file @
d70f8f38
...
...
@@ -63,8 +63,9 @@ namespace AutoTurnOver.Models
//Console.WriteLine(tokenDecode);
var
dd
=
new
JwtSecurityToken
(
tokenDecode
.
Replace
(
"Bearer "
,
""
));
var
userId
=
dd
.
Claims
.
FirstOrDefault
(
m
=>
m
.
Type
==
"UserId"
).
Value
;
var
exp
=
dd
.
Claims
.
FirstOrDefault
(
m
=>
m
.
Type
==
"exp"
).
Value
;
var
userData
=
RedisHelper
.
Get
(
"sso-aims-authorization-user-info-"
+
userId
,
()
=>
{
var
userData
=
RedisHelper
.
Get
(
"sso-aims-authorization-user-info-"
+
userId
+
"-"
+
exp
,
()
=>
{
var
getTokenValid
=
ConfigHelper
.
GetValue
(
"Saas_GetTokenValid"
).
ToString
();
var
getUser
=
ConfigHelper
.
GetValue
(
"Saas_GetUser"
).
ToString
();
var
getMenus
=
ConfigHelper
.
GetValue
(
"Saas_GetMenus"
).
ToString
();
...
...
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