Commit 30a73b0a by wyc

登錄判斷

parent 7833a327
......@@ -84,7 +84,7 @@ public ApiResponse<JwtToken> Login([FromBody] LoginRequest request)
new Claim(JwtClaimTypes.QuickLogin, EQuickLogin.NO.ToString()),
};
var roles = _roleService.GetUserRole(user.UserID);
if (roles?.Any() == true)
if (roles?.Any() == true && UnitTypeUtil.Maps.ContainsKey(roles.First().RoleID))
{
var unitTypes = UnitTypeUtil.Maps.GetOrAdd(roles.First().RoleID, (key) => Array.Empty<string>());
claims.Add(new Claim(JwtClaimTypes.UnitType, JsonConvert.SerializeObject(unitTypes)));
......
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