Browse Source

修改拦截

pengcheng 1 month ago
parent
commit
e3f80f00fe

+ 3 - 0
.vscode/settings.json

@@ -0,0 +1,3 @@
+{
+    "java.compile.nullAnalysis.mode": "automatic"
+}

+ 3 - 1
ruoyi-admin/src/main/resources/application.yml

@@ -241,7 +241,9 @@ swagger:
       basePackage: com.ruoyi.demo
     - name: 2.系统模块
       basePackage: com.ruoyi.web
-    - name: 3.代码生成模块
+    - name: 3.小程序模块
+      basePackage: com.ruoyi.api
+    - name: 4.代码生成模块
       basePackage: com.ruoyi.generator
 
 knife4j:

+ 5 - 5
ruoyi-framework/src/main/java/com/ruoyi/framework/config/InterceptorConfiguration.java

@@ -16,11 +16,11 @@ public class InterceptorConfiguration implements WebMvcConfigurer {
 
     @Override
     public void addInterceptors(InterceptorRegistry registry) {
-//        //拦截小程序接口
-//        registry.addInterceptor(loginApiInterceptor)
-//                .addPathPatterns("/api/**")
-//                //放行的接口
-//                .excludePathPatterns("/**/login");
+        //拦截小程序接口
+        registry.addInterceptor(loginApiInterceptor)
+                .addPathPatterns("/api/**")
+                //放行的接口
+                .excludePathPatterns("/**/login");
 
     }
 

+ 0 - 2
ruoyi-framework/src/main/java/com/ruoyi/framework/interceptor/LoginApiInterceptor.java

@@ -33,8 +33,6 @@ public class LoginApiInterceptor implements HandlerInterceptor {
     @Resource
     private ApiTokenService apiTokenService;
     @Resource
-    private IUserService userService;
-    @Resource
     private IEmployeeService employeeService;
     @Resource
     private ISysConfigService sysConfigService;