style: 错误信息英文返回-system 模块路由
This commit is contained in:
@@ -49,7 +49,7 @@ func (s *SysLogLoginController) List(c *gin.Context) {
|
||||
func (s *SysLogLoginController) Remove(c *gin.Context) {
|
||||
infoIds := c.Param("infoIds")
|
||||
if infoIds == "" {
|
||||
c.JSON(400, result.CodeMsg(400, "参数错误"))
|
||||
c.JSON(400, result.CodeMsg(400, "parameter error"))
|
||||
return
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ func (s *SysLogLoginController) Remove(c *gin.Context) {
|
||||
}
|
||||
rows := s.sysLogLoginService.DeleteSysLogLoginByIds(uniqueIDs)
|
||||
if rows > 0 {
|
||||
msg := fmt.Sprintf("删除成功:%d", rows)
|
||||
msg := fmt.Sprintf("Deleted successfully: %d", rows)
|
||||
c.JSON(200, result.OkMsg(msg))
|
||||
return
|
||||
}
|
||||
@@ -87,7 +87,7 @@ func (s *SysLogLoginController) Clean(c *gin.Context) {
|
||||
func (s *SysLogLoginController) Unlock(c *gin.Context) {
|
||||
userName := c.Param("userName")
|
||||
if userName == "" {
|
||||
c.JSON(400, result.CodeMsg(400, "参数错误"))
|
||||
c.JSON(400, result.CodeMsg(400, "parameter error"))
|
||||
return
|
||||
}
|
||||
ok := s.accountService.ClearLoginRecordCache(userName)
|
||||
@@ -106,7 +106,8 @@ func (s *SysLogLoginController) Export(c *gin.Context) {
|
||||
querys := ctx.BodyJSONMap(c)
|
||||
data := s.sysLogLoginService.SelectSysLogLoginPage(querys)
|
||||
if data["total"].(int64) == 0 {
|
||||
c.JSON(200, result.ErrMsg("导出数据记录为空"))
|
||||
// 导出数据记录为空
|
||||
c.JSON(200, result.ErrMsg("Export data record is empty"))
|
||||
return
|
||||
}
|
||||
rows := data["rows"].([]model.SysLogLogin)
|
||||
@@ -115,24 +116,24 @@ func (s *SysLogLoginController) Export(c *gin.Context) {
|
||||
fileName := fmt.Sprintf("sys_log_login_export_%d_%d.xlsx", len(rows), time.Now().UnixMilli())
|
||||
// 第一行表头标题
|
||||
headerCells := map[string]string{
|
||||
"A1": "序号",
|
||||
"B1": "用户账号",
|
||||
"C1": "登录状态",
|
||||
"D1": "登录地址",
|
||||
"E1": "登录地点",
|
||||
"F1": "浏览器",
|
||||
"G1": "操作系统",
|
||||
"H1": "提示消息",
|
||||
"I1": "访问时间",
|
||||
"A1": "ID",
|
||||
"B1": "UserName",
|
||||
"C1": "Status",
|
||||
"D1": "IP",
|
||||
"E1": "Location",
|
||||
"F1": "Browser",
|
||||
"G1": "OS",
|
||||
"H1": "Msg",
|
||||
"I1": "Time",
|
||||
}
|
||||
// 从第二行开始的数据
|
||||
dataCells := make([]map[string]any, 0)
|
||||
for i, row := range rows {
|
||||
idx := strconv.Itoa(i + 2)
|
||||
// 状态
|
||||
statusValue := "失败"
|
||||
statusValue := "fail"
|
||||
if row.Status == "1" {
|
||||
statusValue = "成功"
|
||||
statusValue = "successes"
|
||||
}
|
||||
dataCells = append(dataCells, map[string]any{
|
||||
"A" + idx: row.LoginID,
|
||||
|
||||
Reference in New Issue
Block a user