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
e9e69be7
Commit
e9e69be7
authored
Apr 23, 2021
by
ruyun.zhang@suvalue.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '夜班绩效位置迁移' into v2020morge-job
parents
07641714
5b92c91c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
13 deletions
+13
-13
performance/Performance.Api/Controllers/AccountController.cs
+10
-10
performance/Performance.Services/RoleService.cs
+1
-1
performance/Performance.Services/UserService.cs
+2
-2
No files found.
performance/Performance.Api/Controllers/AccountController.cs
View file @
e9e69be7
...
@@ -92,13 +92,13 @@ public ApiResponse<JwtToken> Refresh()
...
@@ -92,13 +92,13 @@ public ApiResponse<JwtToken> Refresh()
var
userClaim
=
_claim
.
GetUserClaim
();
var
userClaim
=
_claim
.
GetUserClaim
();
var
claims
=
new
Claim
[]
var
claims
=
new
Claim
[]
{
{
new
Claim
(
JwtClaimTypes
.
Id
,
userClaim
.
FirstOrDefault
(
t
=>
t
.
Type
==
JwtClaimTypes
.
Id
)
.
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
.
Login
,
userClaim
.
FirstOrDefault
(
t
=>
t
.
Type
==
JwtClaimTypes
.
Login
)
?.
Value
??
""
),
new
Claim
(
JwtClaimTypes
.
RealName
,
userClaim
.
FirstOrDefault
(
t
=>
t
.
Type
==
JwtClaimTypes
.
RealName
)
.
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
.
Mail
,
userClaim
.
FirstOrDefault
(
t
=>
t
.
Type
==
JwtClaimTypes
.
Mail
)
?.
Value
??
""
),
new
Claim
(
JwtClaimTypes
.
AppName
,
userClaim
.
FirstOrDefault
(
t
=>
t
.
Type
==
JwtClaimTypes
.
AppName
)
.
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
.
Device
,
userClaim
.
FirstOrDefault
(
t
=>
t
.
Type
==
JwtClaimTypes
.
Device
)
?.
Value
??
""
),
new
Claim
(
JwtClaimTypes
.
Department
,
userClaim
.
FirstOrDefault
(
t
=>
t
.
Type
==
JwtClaimTypes
.
Department
)
.
Value
),
new
Claim
(
JwtClaimTypes
.
Department
,
userClaim
.
FirstOrDefault
(
t
=>
t
.
Type
==
JwtClaimTypes
.
Department
)
?.
Value
??
""
),
};
};
var
jwtToken
=
JwtTokenHelper
.
GenerateToken
(
claims
,
_options
.
ExpirationMinutes
);
var
jwtToken
=
JwtTokenHelper
.
GenerateToken
(
claims
,
_options
.
ExpirationMinutes
);
...
@@ -271,9 +271,9 @@ public ApiResponse<JwtToken> DemoUsers(int userId)
...
@@ -271,9 +271,9 @@ public ApiResponse<JwtToken> DemoUsers(int userId)
new
Claim
(
JwtClaimTypes
.
Id
,
user
.
UserID
.
ToString
()),
new
Claim
(
JwtClaimTypes
.
Id
,
user
.
UserID
.
ToString
()),
new
Claim
(
JwtClaimTypes
.
Login
,
user
.
Login
),
new
Claim
(
JwtClaimTypes
.
Login
,
user
.
Login
),
new
Claim
(
JwtClaimTypes
.
RealName
,
user
.
RealName
),
new
Claim
(
JwtClaimTypes
.
RealName
,
user
.
RealName
),
new
Claim
(
JwtClaimTypes
.
Mail
,
user
.
Mail
),
new
Claim
(
JwtClaimTypes
.
Mail
,
user
.
Mail
??
""
),
new
Claim
(
JwtClaimTypes
.
AppName
,
userClaim
.
FirstOrDefault
(
t
=>
t
.
Type
==
JwtClaimTypes
.
AppName
)
.
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
.
Device
,
userClaim
.
FirstOrDefault
(
t
=>
t
.
Type
==
JwtClaimTypes
.
Device
)
?.
Value
??
""
),
new
Claim
(
JwtClaimTypes
.
Department
,
user
.
Department
??
""
),
new
Claim
(
JwtClaimTypes
.
Department
,
user
.
Department
??
""
),
};
};
...
...
performance/Performance.Services/RoleService.cs
View file @
e9e69be7
...
@@ -60,7 +60,7 @@ public List<RoleResponse> GetUsersRole(int userid)
...
@@ -60,7 +60,7 @@ public List<RoleResponse> GetUsersRole(int userid)
List
<
RoleResponse
>
roleResponses
=
new
List
<
RoleResponse
>();
List
<
RoleResponse
>
roleResponses
=
new
List
<
RoleResponse
>();
var
user
=
_userRepository
.
GetEntity
(
c
=>
c
.
ID
==
userid
);
var
user
=
_userRepository
.
GetEntity
(
c
=>
c
.
ID
==
userid
);
var
ParentUser
=
_userRepository
.
GetEntities
(
c
=>
c
.
ParentID
==
userid
);
var
ParentUser
=
_userRepository
.
GetEntities
(
c
=>
c
.
ParentID
==
userid
);
if
(
user
.
ParentID
!=
null
||
user
.
ParentID
=
=
0
)
if
(
user
.
ParentID
!=
null
&&
user
.
ParentID
!
=
0
)
{
{
ParentUser
=
_userRepository
.
GetEntities
(
c
=>
c
.
ParentID
==
user
.
ParentID
);
ParentUser
=
_userRepository
.
GetEntities
(
c
=>
c
.
ParentID
==
user
.
ParentID
);
}
}
...
...
performance/Performance.Services/UserService.cs
View file @
e9e69be7
...
@@ -526,8 +526,8 @@ public UserResponse ResetPwd(int userId, int loginUserId)
...
@@ -526,8 +526,8 @@ public UserResponse ResetPwd(int userId, int loginUserId)
if
(
user
==
null
)
if
(
user
==
null
)
throw
new
PerformanceException
(
$"用户不存在 UserId:
{
userId
}
"
);
throw
new
PerformanceException
(
$"用户不存在 UserId:
{
userId
}
"
);
if
(
user
.
CreateUser
!=
loginUserId
)
//
if (user.CreateUser != loginUserId)
throw
new
PerformanceException
(
$"当前用户无权限重置用户密码"
);
//
throw new PerformanceException($"当前用户无权限重置用户密码");
user
.
Password
=
"123456"
;
user
.
Password
=
"123456"
;
if
(!
_userRepository
.
Update
(
user
))
if
(!
_userRepository
.
Update
(
user
))
...
...
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