浏览代码

manager验证码修改

yinhao 4 年之前
父节点
当前提交
587fe77117

+ 7 - 0
huimv-mobile-video/huimv-manager/src/main/java/com/huimv/manager/exception/RRExceptionHandler.java

@@ -1,6 +1,7 @@
 package com.huimv.manager.exception;
 
 import cn.dustlight.captcha.store.CodeNotExistsException;
+import cn.dustlight.captcha.verifier.VerifyFailException;
 import com.huimv.manager.enums.AuthExceptionEnum;
 import com.huimv.manager.result.R;
 import org.slf4j.Logger;
@@ -55,6 +56,12 @@ public class RRExceptionHandler {
 		return R.error(AuthExceptionEnum.CONSTANT_EMPTY_ERROR.getMessage());
 	}
 
+	@ExceptionHandler(VerifyFailException.class)
+	public R handVerifyFailException(VerifyFailException e){
+		logger.error(e.getMessage(), e);
+		return R.error(AuthExceptionEnum.CONSTANT_EMPTY_ERROR.getMessage());
+	}
+
 	@ExceptionHandler(AuthException.class)
 	public R handAuthException(AuthException e){
 		logger.error(e.getMessage(), e);

+ 1 - 1
huimv-mobile-video/huimv-manager/src/main/java/com/huimv/manager/modular/service/impl/MobileUserServiceImpl.java

@@ -45,7 +45,7 @@ public class MobileUserServiceImpl implements MobileUserService {
             throw new AuthException(AuthExceptionEnum.ACCOUNT_PWD_ERROR);
         }
 
-        if (mobileUser.getGrantClass().equals(AdminTypeEnum.ADMIN.getCode())) {
+        if (!mobileUser.getGrantClass().equals(AdminTypeEnum.ADMIN.getCode())) {
             throw new RRException("对不起,你不是管理员,不能登录此系统!",401);
         }