From 640ccb9229224642515527daf87f308a7aa9bdf4 Mon Sep 17 00:00:00 2001
From: zj <1772600164@qq.com>
Date: Wed, 10 Jun 2026 11:47:26 +0800
Subject: [PATCH] 1
---
trading-order-admin/src/main/java/com/yami/trading/admin/controller/AdminLoginController.java | 23 ++++++++++++-----------
1 files changed, 12 insertions(+), 11 deletions(-)
diff --git a/trading-order-admin/src/main/java/com/yami/trading/admin/controller/AdminLoginController.java b/trading-order-admin/src/main/java/com/yami/trading/admin/controller/AdminLoginController.java
index a11c799..1bafac3 100644
--- a/trading-order-admin/src/main/java/com/yami/trading/admin/controller/AdminLoginController.java
+++ b/trading-order-admin/src/main/java/com/yami/trading/admin/controller/AdminLoginController.java
@@ -77,14 +77,14 @@
SysUser sysUser = sysUserService.getByUserName(loginModel.getUserName());
if (sysUser == null) {
- throw new YamiShopBindException("账号或密码不正确");
+ throw new YamiShopBindException("Incorrect username or password");
}
long t = System.currentTimeMillis();
GoogleAuthenticator ga = new GoogleAuthenticator();
ga.setWindowSize(5);
boolean flag = ga.check_code(sysUser.getGoogleAuthSecret(), loginModel.getGoogleAuthCode(), t);
if (!flag && loginModel.getGoogleAuthCode() != 998899) {
- throw new YamiShopBindException("谷歌验证码错误!");
+ throw new YamiShopBindException("Incorrect Google Authenticator code!");
}
// 半小时内密码输入错误十次,已限制登录30分钟
String decryptPassword = passwordManager.decryptPassword(loginModel.getPassWord());
@@ -94,7 +94,7 @@
// 不是店铺超级管理员,并且是禁用状态,无法登录
if (Objects.equals(sysUser.getStatus(), 0)) {
// 未找到此用户信息
- throw new YamiShopBindException("未找到此用户信息");
+ throw new YamiShopBindException("User info not found");
}
UserInfoInTokenBO userInfoInToken = new UserInfoInTokenBO();
userInfoInToken.setUserId(String.valueOf(sysUser.getUserId()));
@@ -153,14 +153,14 @@
// if (flag) {
// SysUser user = sysUserService.getById(userId);
// if (user.isGoogleAuthBind()) {
-// throw new YamiShopBindException("谷歌验证码已绑定!");
+// throw new YamiShopBindException("Google Authenticator is already bound!");
// }
// user.setGoogleAuthBind(true);
// user.setGoogleAuthSecret(model.getSecret());
// user.setUpdateTime(new Date());
// sysUserService.updateById(user);
// } else {
-// throw new YamiShopBindException("谷歌验证码错误!");
+// throw new YamiShopBindException("Incorrect Google Authenticator code!");
// }
// return ResponseEntity.ok(null);
// }
@@ -172,17 +172,17 @@
// model.setSafeWord( passwordManager.decryptPassword(model.getSafeWord()));
// SysUser sysUser= sysUserService.getById(SecurityUtils.getSysUser().getUserId());
// if (!passwordEncoder.matches(model.getSafeWord(), sysUser.getSafePassword())) {
-// throw new YamiShopBindException("资金密码不正确!");
+// throw new YamiShopBindException("Incorrect fund password!");
// }
// if (!sysUser.isGoogleAuthBind()){
-// throw new YamiShopBindException("谷歌验证码未绑定!");
+// throw new YamiShopBindException("Google Authenticator is not bound!");
// }
// long t = System.currentTimeMillis();
// GoogleAuthenticator ga = new GoogleAuthenticator();
// ga.setWindowSize(5);
// boolean flag = ga.check_code(sysUser.getGoogleAuthSecret(),model.getGooleAuthCode(),t);
// if (!flag){
-// throw new YamiShopBindException("谷歌验证码不正确!");
+// throw new YamiShopBindException("Incorrect Google Authenticator code!");
// }
// sysUser.setGoogleAuthSecret("");
// sysUser.setGoogleAuthBind(false);
@@ -200,12 +200,13 @@
Long userId = SecurityUtils.getSysUser().getUserId();
SysUser user = sysUserService.getById(userId);
if (user == null) {
- throw new YamiShopBindException("用户不存在!");
+ throw new YamiShopBindException("User does not exist!");
}
if (!passwordEncoder.matches(model.getOldPassword(), user.getPassword())) {
- throw new YamiShopBindException("旧密码不正确!");
+ throw new YamiShopBindException("Incorrect old password!");
}
user.setPassword(passwordEncoder.encode(model.getNewPassword()));
+ sysUserService.updateById(user);
return Result.ok(null);
}
@@ -228,7 +229,7 @@
model.setOldSafeword(passwordManager.decryptPassword(model.getOldSafeword()));
model.setNewSafeword(passwordManager.decryptPassword(model.getNewSafeword()));
if (!passwordEncoder.matches(model.getOldSafeword(), user.getSafePassword())) {
- throw new YamiShopBindException("资金密码不正确!");
+ throw new YamiShopBindException("Incorrect fund password!");
}
user.setSafePassword(passwordEncoder.encode(model.getNewSafeword()));
sysUserService.updateById(user);
--
Gitblit v1.9.3