瀏覽代碼

快手 项目调整

yumeng 5 年之前
父節點
當前提交
d75147f10d
共有 1 個文件被更改,包括 8 次插入7 次删除
  1. 8 7
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/shiro/authc/ShiroRealm.java

+ 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;
     }
 
     /**