Browse Source

fixed 后台用户名重复问题

fushengqian 1 year ago
parent
commit
9612f3ffe9

+ 1 - 0
fuint-application/src/main/java/com/fuint/common/service/impl/AccountServiceImpl.java

@@ -142,6 +142,7 @@ public class AccountServiceImpl extends ServiceImpl<TAccountMapper, TAccount> im
     public AccountInfo getAccountByName(String userName) {
         Map<String, Object> param = new HashMap();
         param.put("account_name", userName);
+        param.put("account_status", 1);
         List<TAccount> accountList = tAccountMapper.selectByMap(param);
         if (accountList != null && accountList.size() > 0) {
             AccountInfo accountInfo = new AccountInfo();

+ 2 - 2
fuint-application/src/main/java/com/fuint/module/backendApi/controller/BackendAccountController.java

@@ -222,7 +222,7 @@ public class BackendAccountController extends BaseController {
         String staffId = param.get("staffId") == null ? "0" : param.get("staffId").toString();
 
         AccountInfo accountInfo = tAccountService.getAccountByName(accountName);
-        if (accountInfo != null && accountInfo.getAccountStatus() == 1) {
+        if (accountInfo != null) {
             return getFailureResult(201, "该用户名已存在");
         }
 
@@ -309,7 +309,7 @@ public class BackendAccountController extends BaseController {
         }
 
         AccountInfo accountInfo = tAccountService.getAccountByName(accountName);
-        if (accountInfo != null && accountInfo.getId() != id.intValue() && accountInfo.getAccountStatus() == 1) {
+        if (accountInfo != null && accountInfo.getId() != id.intValue()) {
             return getFailureResult(201, "该用户名已存在");
         }