Browse Source

fixed 店铺和商户被禁用 不能再登录

fushengqian 1 year ago
parent
commit
4099aaa94d

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

@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.fuint.common.dto.AccountDto;
 import com.fuint.common.dto.AccountDto;
 import com.fuint.common.dto.AccountInfo;
 import com.fuint.common.dto.AccountInfo;
+import com.fuint.common.enums.StatusEnum;
 import com.fuint.common.service.AccountService;
 import com.fuint.common.service.AccountService;
 import com.fuint.common.service.CaptchaService;
 import com.fuint.common.service.CaptchaService;
 import com.fuint.common.service.StaffService;
 import com.fuint.common.service.StaffService;
@@ -382,6 +383,22 @@ public class AccountServiceImpl extends ServiceImpl<TAccountMapper, TAccount> im
                 throw new BusinessCheckException("登录账号或密码有误");
                 throw new BusinessCheckException("登录账号或密码有误");
             }
             }
 
 
+            // 商户已禁用
+            if (tAccount.getMerchantId() != null && tAccount.getMerchantId() > 0) {
+                MtMerchant mtMerchant = mtMerchantMapper.selectById(tAccount.getMerchantId());
+                if (mtMerchant != null && !mtMerchant.getStatus().equals(StatusEnum.ENABLED.getKey())) {
+                    throw new BusinessCheckException("您的商户已被禁用,请联系平台方");
+                }
+            }
+
+            // 店铺已禁用
+            if (tAccount.getStoreId() != null && tAccount.getStoreId() > 0) {
+                MtStore mtStore = mtStoreMapper.selectById(tAccount.getStoreId());
+                if (mtStore != null && !mtStore.getStatus().equals(StatusEnum.ENABLED.getKey())) {
+                    throw new BusinessCheckException("您的店铺已被禁用,请联系平台方");
+                }
+            }
+
             String token = TokenUtil.generateToken(userAgent, accountInfo);
             String token = TokenUtil.generateToken(userAgent, accountInfo);
             LoginResponse response = new LoginResponse();
             LoginResponse response = new LoginResponse();
             response.setLogin(true);
             response.setLogin(true);