mirror of
https://github.com/halejohn/Cloudreve.git
synced 2026-01-26 09:34:57 +08:00
Fix: standardize the use of error codes related to login credentials
This commit is contained in:
@@ -171,10 +171,10 @@ func (service *UserLoginService) Login(c *gin.Context) serializer.Response {
|
||||
|
||||
// 一系列校验
|
||||
if err != nil {
|
||||
return serializer.Err(401, "用户邮箱或密码错误", err)
|
||||
return serializer.Err(serializer.CodeCredentialInvalid, "用户邮箱或密码错误", err)
|
||||
}
|
||||
if authOK, _ := expectedUser.CheckPassword(service.Password); !authOK {
|
||||
return serializer.Err(401, "用户邮箱或密码错误", nil)
|
||||
return serializer.Err(serializer.CodeCredentialInvalid, "用户邮箱或密码错误", nil)
|
||||
}
|
||||
if expectedUser.Status == model.Baned || expectedUser.Status == model.OveruseBaned {
|
||||
return serializer.Err(403, "该账号已被封禁", nil)
|
||||
|
||||
Reference in New Issue
Block a user