public async Task <IActionResult> GetWriteState(int mouth, int year = 2020) { var userId = _User.ID; if (userId == 0) { _logger.LogWarning($"{DateTime.Now} 请求GetWriteState access_token 无效"); this.HttpContext.Response.StatusCode = 401; return(Ok(new { Success = false, Msg = "Token无效 Httpcontext 解析失败", this.HttpContext.Response.StatusCode })); } var result = await _ProjectInfoService.IsEnableMouth(userId, mouth, year); _logger.LogInformation($"IP: {_User.GetClientIP()} 用户名:{_User.Name} ID:{_User.ID} 查询了GetWriteState接口"); return(Ok(new { Success = result, Msg = "接口请求成功", this.HttpContext.Response.StatusCode })); }