✨ add api validation signature
This commit is contained in:
@@ -19,6 +19,8 @@ type AccountLoginRequest struct {
|
||||
Account string `json:"account" binding:"required"`
|
||||
Password string `json:"password" binding:"required"`
|
||||
AutoLogin bool `json:"auto_login" binding:"required"`
|
||||
Angle int64 `json:"angle" binding:"required"`
|
||||
Key string `json:"key" binding:"required"`
|
||||
}
|
||||
|
||||
// AddUserRequest 新增用户请求
|
||||
|
@@ -117,6 +117,11 @@ func (UserAPI) AccountLogin(c *gin.Context) {
|
||||
result.FailWithMessage(ginI18n.MustGetMessage(c, "ParamsError"), c)
|
||||
return
|
||||
}
|
||||
rotateData := utils.CheckRotateData(accountLoginRequest.Angle, accountLoginRequest.Key)
|
||||
if !rotateData {
|
||||
result.FailWithMessage(ginI18n.MustGetMessage(c, "CaptchaVerifyError"), c)
|
||||
return
|
||||
}
|
||||
account := accountLoginRequest.Account
|
||||
password := accountLoginRequest.Password
|
||||
|
||||
|
Reference in New Issue
Block a user