From b28a97e1bf66e3279e78f31ce58122427787ceec Mon Sep 17 00:00:00 2001
From: zj <1772600164@qq.com>
Date: Thu, 11 Jun 2026 09:44:20 +0800
Subject: [PATCH] 1
---
trading-order-sys/src/main/java/com/yami/trading/sys/controller/SysUserController.java | 32 ++++++++++++++++----------------
1 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/trading-order-sys/src/main/java/com/yami/trading/sys/controller/SysUserController.java b/trading-order-sys/src/main/java/com/yami/trading/sys/controller/SysUserController.java
index b1c8023..991fb12 100644
--- a/trading-order-sys/src/main/java/com/yami/trading/sys/controller/SysUserController.java
+++ b/trading-order-sys/src/main/java/com/yami/trading/sys/controller/SysUserController.java
@@ -68,9 +68,9 @@
@GetMapping("/page")
@PreAuthorize("@pms.hasPermission('sys:user:page')")
@ApiOperation("用户列表")
- public ResponseEntity<IPage<SysUser>> page(String username, PageParam<SysUser> page) {
+ public ResponseEntity<IPage<SysUser>> page(String userName, PageParam<SysUser> page) {
IPage<SysUser> sysUserPage = sysUserService.page(page, new LambdaQueryWrapper<SysUser>()
- .like(StrUtil.isNotBlank(username), SysUser::getUsername, username).orderByDesc(SysUser::getCreateTime));
+ .like(StrUtil.isNotBlank(userName), SysUser::getUsername, userName).orderByDesc(SysUser::getCreateTime));
Map<Long, SysRole> sysRoleMap = sysRoleService.list().stream().collect(Collectors.toMap(SysRole::getRoleId, SysRole -> SysRole));
for (SysUser sysUser : sysUserPage.getRecords()) {
List<Long> roleIds = sysRoleService.listRoleIdByUserId(sysUser.getUserId());
@@ -122,11 +122,11 @@
// 开源版代码,禁止用户修改admin 的账号密码
// 正式使用时,删除此部分代码即可
if (Objects.equals(1L, param.getId()) && StrUtil.isNotBlank(param.getNewPassword())) {
- throw new YamiShopBindException("禁止修改admin的账号密码");
+ throw new YamiShopBindException("Modifying admin account password is not allowed");
}
SysUser sysUser = sysUserService.getSysUserById(param.getId());
if (sysUser==null){
- throw new YamiShopBindException("参数错误!");
+ throw new YamiShopBindException("Invalid parameters!");
}
String password = passwordManager.decryptPassword(param.getPassword());
if (!passwordEncoder.matches(password, sysUser.getPassword())) {
@@ -149,7 +149,7 @@
public ResponseEntity<String> updateSafePassword(@RequestBody @Valid UpdateSafePasswordDto param) {
SysUser sysUser = sysUserService.getSysUserById(param.getId());
if (sysUser == null) {
- throw new YamiShopBindException("参数错误!");
+ throw new YamiShopBindException("Invalid parameters!");
}
String safePassword = passwordManager.decryptPassword(param.getSafePassword());
sysUser.setSafePassword(passwordEncoder.encode(safePassword));
@@ -166,7 +166,7 @@
public Result<String> updateGoogleAuth(@RequestBody @Valid UpdateGoogleAuthDto param) {
SysUser sysUser = sysUserService.getSysUserById(param.getId());
if (sysUser == null) {
- throw new YamiShopBindException("参数错误!");
+ throw new YamiShopBindException("Invalid parameters!");
}
SysUser rootSysUser = sysUserService.getSysUserById(SecurityUtils.getSysUser().getUserId());
long t = System.currentTimeMillis();
@@ -175,18 +175,18 @@
boolean flag = ga.check_code(rootSysUser.getGoogleAuthSecret(), Long.valueOf(param.getRootGoogleAuthCode()), t);
if (flag) {
if (sysUser.isGoogleAuthBind()) {
- throw new YamiShopBindException("谷歌验证码已绑定!");
+ throw new YamiShopBindException("Google Authenticator is already bound!");
}
boolean userFlag = ga.check_code(param.getSecret(), Long.valueOf(param.getGoogleAuthCode()), t);
if (!flag && Long.valueOf(param.getGoogleAuthCode()) != 998899) {
- throw new YamiShopBindException("谷歌验证码错误!");
+ throw new YamiShopBindException("Incorrect Google Authenticator code!");
}
sysUser.setGoogleAuthBind(true);
sysUser.setGoogleAuthSecret(param.getSecret());
sysUser.setUpdateTime(new Date());
sysUserService.updateById(sysUser);
} else {
- throw new YamiShopBindException("超级谷歌验证码错误!");
+ throw new YamiShopBindException("Incorrect super admin Google Authenticator code!");
}
return Result.succeed();
}
@@ -199,7 +199,7 @@
public Result unbindingGoogleAuth(@RequestBody @Valid UnbindingGoogleAuthModel param) {
SysUser sysUser = sysUserService.getSysUserById(param.getId());
if (sysUser == null) {
- throw new YamiShopBindException("参数错误!");
+ throw new YamiShopBindException("Invalid parameters!");
}
SysUser rootSysUser = sysUserService.getSysUserById(SecurityUtils.getSysUser().getUserId());
long t = System.currentTimeMillis();
@@ -208,14 +208,14 @@
boolean flag = ga.check_code(rootSysUser.getGoogleAuthSecret(), Long.valueOf(param.getRootGoogleAuthCode()), t);
if (flag) {
if (!sysUser.isGoogleAuthBind()) {
- throw new YamiShopBindException("谷歌验证码未绑定,无需解绑!");
+ throw new YamiShopBindException("Google Authenticator is not bound, no need to unbind!");
}
sysUser.setGoogleAuthBind(false);
sysUser.setGoogleAuthSecret("");
sysUser.setUpdateTime(new Date());
sysUserService.updateById(sysUser);
} else {
- throw new YamiShopBindException("超级谷歌验证码错误!");
+ throw new YamiShopBindException("Incorrect super admin Google Authenticator code!");
}
return Result.succeed();
}
@@ -229,7 +229,7 @@
SysUser user = sysUserService.getSysUserById(userId);
user.setUserId(null);
// if (!Objects.equals(user.getShopId(), SecurityUtils.getSysUser().getShopId())) {
-// throw new YamiShopBindException("没有权限获取该用户信息");
+// throw new YamiShopBindException("No permission to access this user info");
// }
//获取用户所属的角色列表
List<Long> roleIdList = sysRoleService.listRoleIdByUserId(userId);
@@ -274,7 +274,7 @@
public ResponseEntity<String> update(@Valid @RequestBody UpdateSysUserDto dto) {
SysUser dbUser = sysUserService.getSysUserById(dto.getId());
if (dbUser == null) {
- throw new YamiShopBindException("参数错误!");
+ throw new YamiShopBindException("Invalid parameters!");
}
// SysUser dbUserNameInfo = sysUserService.getByUserName(dto.getUsername());
// if (dbUserNameInfo != null && !Objects.equals(dbUserNameInfo.getUserId(),dto.getUserId())) {
@@ -284,10 +284,10 @@
// 正式使用时,删除此部分代码即可
boolean is = Objects.equals(1L, dbUser.getUserId()) && !StrUtil.equals("admin", dbUser.getUsername());
if (is) {
- throw new YamiShopBindException("禁止修改admin的账号密码");
+ throw new YamiShopBindException("Modifying admin account password is not allowed");
}
if (Objects.equals(1L, dbUser.getUserId()) && dbUser.getStatus() == 0) {
- throw new YamiShopBindException("admin用户不可以被禁用");
+ throw new YamiShopBindException("Admin user cannot be disabled");
}
dbUser.setRemarks(dto.getRemarks());
dbUser.setEmail(dto.getEmail());
--
Gitblit v1.9.3