Selaa lähdekoodia

快手 项目调整

yumeng 5 vuotta sitten
vanhempi
commit
d75147f10d

+ 8 - 7
jeecg-boot-module-system/src/main/java/org/jeecg/modules/shiro/authc/ShiroRealm.java

@@ -83,14 +83,15 @@ public class ShiroRealm extends AuthorizingRealm {
      */
     @Override
     protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken auth) throws AuthenticationException {
-        log.debug("————身份认证————");
-        String token = (String) auth.getCredentials();
-        if (token == null) {
-            log.error("token为空!");
+        log.info("————身份认证————");
+        if (!Check.isNull(auth)) {
+            String token = (String) auth.getCredentials();
+            if (token != null) {
+                LoginUser loginUser = this.checkUserTokenIsEffect(token);
+                return new SimpleAuthenticationInfo(loginUser, token, getName());
+            }
         }
-        // 校验token有效性
-        LoginUser loginUser = this.checkUserTokenIsEffect(token);
-        return new SimpleAuthenticationInfo(loginUser, token, getName());
+        return null;
     }
 
     /**