public async Task <ResponseMessage> PulshUserRole(UserRolesRequest rolesRequest) { var users = DataBaseUser.TokenModel; _Logger.LogInformation($"用户{users?.UserName ?? ""},其ID:({users?.Id ?? ""}) 添加用户角色表:\r\n" + (rolesRequest != null ? JsonHelpers.ToJSON(rolesRequest) : "")); var response = new ResponseMessage(); try { response = await _RolesManager.AddUserRoles(rolesRequest); } catch (Exception el) { _Logger.LogError($"用户{users?.UserName ?? ""}({users?.Id ?? ""})添加用户角色表报错:\r\n{el.ToString()}"); response.Code = ResponseCodeDefines.ArgumentNullError; response.Message = $"添加用户角色表报错:{el.Message}"; } return(response); }