pang.jiabao
2 天以前 929c6226f73c61eff618963b8a2b7d83841f6fa5
src/main/java/com/zy/common/config/AdminInterceptor.java
@@ -1,6 +1,7 @@
package com.zy.common.config;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.core.annotations.AppAuth;
import com.core.annotations.ManagerAuth;
import com.core.common.BaseRes;
import com.core.common.Cools;
@@ -86,6 +87,16 @@
        }
        // 跨域设置
        // response.setHeader("Access-Control-Allow-Origin", "*");
        HandlerMethod appAuthHandlerMethod = (HandlerMethod) handler;
        Method appAuthMethod = appAuthHandlerMethod.getMethod();
        if (appAuthMethod.isAnnotationPresent(AppAuth.class)){
            AppAuth annotation = method.getAnnotation(AppAuth.class);
            if (annotation.value().equals(AppAuth.Auth.CHECK)){
                request.setAttribute("appAuth", annotation.memo());
            }
        }
        if (method.isAnnotationPresent(ManagerAuth.class)) {
            ManagerAuth annotation = method.getAnnotation(ManagerAuth.class);
            if (annotation.value().equals(ManagerAuth.Auth.CHECK)) {