style: 错误信息英文返回-common 模块路由
This commit is contained in:
@@ -36,7 +36,7 @@ type AccountController struct {
|
||||
func (s *AccountController) Login(c *gin.Context) {
|
||||
var loginBody commonModel.LoginBody
|
||||
if err := c.ShouldBindJSON(&loginBody); err != nil {
|
||||
c.JSON(400, result.CodeMsg(400, "参数错误"))
|
||||
c.JSON(400, result.CodeMsg(400, "parameter error"))
|
||||
return
|
||||
}
|
||||
|
||||
@@ -74,8 +74,9 @@ func (s *AccountController) Login(c *gin.Context) {
|
||||
return
|
||||
} else {
|
||||
s.accountService.UpdateLoginDateAndIP(&loginUser)
|
||||
// 登录成功
|
||||
s.sysLogLoginService.CreateSysLogLogin(
|
||||
loginBody.Username, commonConstants.STATUS_YES, "登录成功",
|
||||
loginBody.Username, commonConstants.STATUS_YES, "Login Successful",
|
||||
ipaddr, location, os, browser,
|
||||
)
|
||||
}
|
||||
@@ -133,13 +134,13 @@ func (s *AccountController) Logout(c *gin.Context) {
|
||||
// 当前请求信息
|
||||
ipaddr, location := ctxUtils.IPAddrLocation(c)
|
||||
os, browser := ctxUtils.UaOsBrowser(c)
|
||||
// 创建系统访问记录
|
||||
// 创建系统访问记录 退出成功
|
||||
s.sysLogLoginService.CreateSysLogLogin(
|
||||
userName, commonConstants.STATUS_YES, "退出成功",
|
||||
userName, commonConstants.STATUS_YES, "Exit successful",
|
||||
ipaddr, location, os, browser,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
c.JSON(200, result.OkMsg("退出成功"))
|
||||
c.JSON(200, result.OkMsg("Exit successful"))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user