瀏覽代碼

拦截bug

wangys 5 年之前
父節點
當前提交
c3c9bf1807
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      src/main/java/cn/efunbox/audio/aop/AuthInterceptor.java

+ 2 - 2
src/main/java/cn/efunbox/audio/aop/AuthInterceptor.java

@@ -40,8 +40,8 @@ public class AuthInterceptor implements HandlerInterceptor {
         if(device==null){
             HttpUtil.responseApiCode(request, response, ApiCode.NOT_FOUND);
             return false;
-        }else if(device.getTokenNew()==null || !device.getTokenNew().equalsIgnoreCase(token)
-                || device.getTokenOld()==null || !device.getTokenOld().equalsIgnoreCase(token)){
+        }else if((device.getTokenNew()==null || false == device.getTokenNew().equalsIgnoreCase(token))
+                && (device.getTokenOld()==null || false == device.getTokenOld().equalsIgnoreCase(token))){
             HttpUtil.responseApiCode(request,response, ApiCode.INVALID_TOKEN);
             return false;
         }