Commit e9e69be7 by ruyun.zhang@suvalue.com

Merge branch '夜班绩效位置迁移' into v2020morge-job

parents 07641714 5b92c91c
...@@ -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 ?? ""),
}; };
......
...@@ -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);
} }
......
...@@ -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))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment