|
@@ -1,6 +1,10 @@
|
|
|
package com.bosshand.virgo.core.shiro;
|
|
|
|
|
|
+import com.alibaba.druid.util.StringUtils;
|
|
|
+import com.bosshand.virgo.core.model.MgrUser;
|
|
|
+import com.bosshand.virgo.core.service.MgrUserService;
|
|
|
import com.bosshand.virgo.core.utils.CodeCache;
|
|
|
+import com.bosshand.virgo.exception.Constant;
|
|
|
import org.apache.shiro.authc.AuthenticationException;
|
|
|
import org.apache.shiro.authc.AuthenticationInfo;
|
|
|
import org.apache.shiro.authc.AuthenticationToken;
|
|
@@ -13,10 +17,6 @@ import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
-import com.alibaba.druid.util.StringUtils;
|
|
|
-import com.bosshand.virgo.core.model.MgrUser;
|
|
|
-import com.bosshand.virgo.core.service.MgrUserService;
|
|
|
-
|
|
|
@Component
|
|
|
public class UserRealm extends AuthorizingRealm {
|
|
|
|
|
@@ -28,6 +28,11 @@ public class UserRealm extends AuthorizingRealm {
|
|
|
@Override
|
|
|
protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken authenticationToken)throws AuthenticationException {
|
|
|
logger.warn("Identity Authentication");
|
|
|
+
|
|
|
+ if(authenticationToken.getPrincipal() == null){
|
|
|
+ throw new AuthenticationException(Constant.RET_INVALID_CODE);
|
|
|
+ }
|
|
|
+
|
|
|
String phone = authenticationToken.getPrincipal().toString();
|
|
|
|
|
|
if (StringUtils.isEmpty(phone)) {
|