From 8d90833250abee5951572659e9a192f2487cd704 Mon Sep 17 00:00:00 2001
From: zhang <zc857179121@qq.com>
Date: 星期一, 03 十一月 2025 09:30:52 +0800
Subject: [PATCH] 标准wms2.0
---
 src/main/java/com/zy/common/config/AdminInterceptor.java |   26 +++++++++++++-------------
 1 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/src/main/java/com/zy/common/config/AdminInterceptor.java b/src/main/java/com/zy/common/config/AdminInterceptor.java
index 795e7a1..93de709 100644
--- a/src/main/java/com/zy/common/config/AdminInterceptor.java
+++ b/src/main/java/com/zy/common/config/AdminInterceptor.java
@@ -1,6 +1,5 @@
 package com.zy.common.config;
 
-import com.alibaba.fastjson.JSON;
 import com.baomidou.mybatisplus.mapper.EntityWrapper;
 import com.core.annotations.AppAuth;
 import com.core.annotations.ManagerAuth;
@@ -53,12 +52,12 @@
         }
         // super璐﹀彿
         String token = request.getHeader("token");
-        if (token!=null) {
+        if (token != null) {
             String deToken = Cools.deTokn(token, superPwd);
-            if (deToken!=null){
+            if (deToken != null) {
                 long timestamp = Long.parseLong(deToken.substring(0, 13));
                 // 1澶╁悗杩囨湡
-                if (System.currentTimeMillis() - timestamp > loadingConfigTimer.getTokenExpire()){
+                if (System.currentTimeMillis() - timestamp > loadingConfigTimer.getTokenExpire()) {
                     Http.response(response, BaseRes.DENIED);
                     return false;
                 }
@@ -77,15 +76,15 @@
         // response.setHeader("Access-Control-Allow-Origin", "*");
         HandlerMethod handlerMethod = (HandlerMethod) handler;
         Method method = handlerMethod.getMethod();
-        if (method.isAnnotationPresent(AppAuth.class)){
+        if (method.isAnnotationPresent(AppAuth.class)) {
             AppAuth annotation = method.getAnnotation(AppAuth.class);
-            if (annotation.value().equals(AppAuth.Auth.CHECK)){
+            if (annotation.value().equals(AppAuth.Auth.CHECK)) {
                 request.setAttribute("appAuth", annotation.memo());
             }
         }
-        if (method.isAnnotationPresent(ManagerAuth.class)){
+        if (method.isAnnotationPresent(ManagerAuth.class)) {
             ManagerAuth annotation = method.getAnnotation(ManagerAuth.class);
-            if (annotation.value().equals(ManagerAuth.Auth.CHECK)){
+            if (annotation.value().equals(ManagerAuth.Auth.CHECK)) {
                 return check(request, response, annotation.memo());
             }
         }
@@ -111,11 +110,11 @@
         try {
             String token = new String();
             token = request.getHeader("token");
-            if (Cools.isEmpty(token)){
+            if (Cools.isEmpty(token)) {
                 return true;
             }
             UserLogin userLogin = userLoginService.selectOne(new EntityWrapper<UserLogin>().eq("token", token));
-            if (null == userLogin){
+            if (null == userLogin) {
                 Http.response(response, BaseRes.DENIED);
                 return false;
             }
@@ -123,7 +122,7 @@
 //            String deToken = Cools.deTokn(token, user.getPassword());
 //            long timestamp = Long.parseLong(deToken.substring(0, 13));
             // 15鍒嗛挓鍚庤繃鏈�
-            if (System.currentTimeMillis() - userLogin.getCreateTime().getTime() > 900000){
+            if (System.currentTimeMillis() - userLogin.getCreateTime().getTime() > 900000) {
                 Http.response(response, BaseRes.DENIED);
                 return false;
             }
@@ -153,7 +152,7 @@
 //                request.setAttribute("operateLog", operateLog);
             }
             return true;
-        } catch (Exception e){
+        } catch (Exception e) {
             Http.response(response, BaseRes.DENIED);
             return false;
         }
@@ -162,6 +161,7 @@
 
     /**
      * 鏉冮檺鎷︽埅
+     *
      * @return false:鏃犳潈闄�;   true:璁よ瘉閫氳繃
      */
     private boolean limit(String action, User user) {
@@ -179,7 +179,7 @@
     /**
      * 璺ㄥ煙
      */
-    public static void cors(HttpServletResponse response){
+    public static void cors(HttpServletResponse response) {
         // 璺ㄥ煙璁剧疆
         response.setHeader("Access-Control-Allow-Origin", "*");
         response.setHeader("Access-Control-Allow-Credentials", "true");
--
Gitblit v1.9.1