public async Task <ApiResult> Logout(ClientTypeInput input) { var userId = HttpContext.User.GetUserId(); if (userId >= 0) { await _tokenService.RevokeRefreshTokenAsync(userId); await _userService.SignOutAsync(userId); await SaveUserActionLogAsync(userId, 2, "注销", input); } var result = new ApiResult { Code = 200, Message = "注销成功", }; return(result); }
private Task SaveUserActionLogAsync(int userId, int actionTypeId, string remark, ClientTypeInput input) { return(_userActionLogService.SaveAsync(new UserActionLogInput { UserId = userId, ActionTypeId = actionTypeId, ClientTypeId = input.ClientTypeId, ClientAgent = input.ClientAgent, Remark = remark }, ModelState)); }