fix: 登录被锁错误返回优化
This commit is contained in:
1 parent
2555b07abe
commit
0659c7624d
4 files changed
+5
-2
No files matched your search
@@ -73,6 +73,7 @@ errors:
|
||||
"500015": "Verification code does not exist"
|
||||
"500016": "SMS sending too frequent, please try again later"
|
||||
"500017": "SMS sending failed"
|
||||
"500018": "Account locked, please try again later"
|
||||
|
||||
# Package order module (60xxxx)
|
||||
cu_package:
|
||||
|
||||
@@ -73,6 +73,7 @@ errors:
|
||||
"500015": "認証コードが存在しません"
|
||||
"500016": "SMS送信が頻繁すぎます。しばらくしてからお試しください"
|
||||
"500017": "SMS送信に失敗しました"
|
||||
"500018": "アカウントがロックされています。しばらくしてからお試しください"
|
||||
|
||||
# セット料金モジュール (60xxxx)
|
||||
cu_package:
|
||||
|
||||
@@ -73,6 +73,7 @@ errors:
|
||||
"500015": "验证码不存在"
|
||||
"500016": "短信发送过于频繁,请稍后再试"
|
||||
"500017": "短信发送失败"
|
||||
"500018": "账号已被锁定,请稍后再试"
|
||||
|
||||
# 套餐订单模块 (60xxxx)
|
||||
cu_package:
|
||||
|
||||
@@ -185,7 +185,7 @@ func (s *cuUserService) Login(ctx context.Context, req *models.CuUserLoginReques
|
||||
// 密码登录(默认行为)
|
||||
// 检查是否被锁定
|
||||
if user.IsAccountLocked() {
|
||||
return nil, "", i18n.NewI18nError("500003", lang) // 账号已被锁定
|
||||
return nil, "", i18n.NewI18nError("500018", lang) // 账号已被锁定
|
||||
}
|
||||
|
||||
// 验证密码
|
||||
@@ -210,7 +210,7 @@ func (s *cuUserService) Login(ctx context.Context, req *models.CuUserLoginReques
|
||||
if err := s.repo.LockAccount(user.ID, lockUntil); err != nil {
|
||||
// 记录错误但不影响登录流程
|
||||
}
|
||||
return nil, "", i18n.NewI18nError("500003", lang) // 账号已被锁定
|
||||
return nil, "", i18n.NewI18nError("500018", lang) // 账号已被锁定
|
||||
}
|
||||
|
||||
return nil, "", i18n.NewI18nError("500003", lang) // 手机号或密码错误
|
||||
|
||||
Reference in new issue
Block a user