This commit is contained in:
iizmg
2020-04-30 08:49:03 +08:00
parent 4d351967fc
commit 2eeea386d4
9 changed files with 102 additions and 11 deletions
+7
View File
@@ -28,6 +28,7 @@
<module>udf-api-common</module>
<module>udf-api-general</module>
<module>udf-api-rbac</module>
<module>udf-api-page</module>
</modules>
<!-- 依赖管理 -->
<dependencyManagement>
@@ -40,6 +41,12 @@
<type>pom</type>
<scope>import</scope>
</dependency>
<!--udf-api-page-->
<dependency>
<groupId>org.itkk.udf</groupId>
<artifactId>udf-api-page</artifactId>
<version>${udf-api.version}</version>
</dependency>
<!--udf-api-rbac-->
<dependency>
<groupId>org.itkk.udf</groupId>
+29
View File
@@ -0,0 +1,29 @@
<?xml version="1.0"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<!-- maven坐标 -->
<artifactId>udf-api-page</artifactId>
<name>udf-api-page</name>
<packaging>jar</packaging>
<url>https://www.itkk.org/</url>
<!-- 父依赖 -->
<parent>
<groupId>org.itkk.udf</groupId>
<artifactId>udf-api</artifactId>
<version>1.0</version>
</parent>
<!-- 依赖 -->
<dependencies>
<!-- udf-api-common -->
<dependency>
<groupId>org.itkk.udf</groupId>
<artifactId>udf-api-common</artifactId>
</dependency>
<!-- udf-api-rbac -->
<dependency>
<groupId>org.itkk.udf</groupId>
<artifactId>udf-api-rbac</artifactId>
</dependency>
</dependencies>
</project>
@@ -0,0 +1,29 @@
package org.itkk.udf.api.page;
import org.itkk.udf.api.page.auth.CommonHandlerInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
/**
* 配置类
*/
@Configuration
public class PageConfiguration implements WebMvcConfigurer {
/**
* commonHandlerInterceptor
*/
@Autowired
private CommonHandlerInterceptor commonHandlerInterceptor;
/**
* 添加拦截器
*
* @param registry registry
*/
@Override
public void addInterceptors(InterceptorRegistry registry) {
registry.addInterceptor(commonHandlerInterceptor).order(1).addPathPatterns("/**");
}
}
@@ -0,0 +1,13 @@
package org.itkk.udf.api.page;
/**
* 常量类
*/
public class PageConstant {
/**
* 私有化构造函数
*/
private PageConstant() {
}
}
@@ -0,0 +1,16 @@
package org.itkk.udf.api.page;
import lombok.extern.slf4j.Slf4j;
/**
* 工具类
*/
@Slf4j
public class PageUtil {
/**
* 私有化构造函数
*/
private PageUtil() {
}
}
@@ -1,4 +1,4 @@
package org.itkk.udf.api.rbac.auth;
package org.itkk.udf.api.page.auth;
import lombok.extern.slf4j.Slf4j;
@@ -1,4 +1,4 @@
package org.itkk.udf.api.server.web;
package org.itkk.udf.api.page.web;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
@@ -1,7 +1,6 @@
package org.itkk.udf.api.rbac;
import org.itkk.udf.api.common.CommonConstant;
import org.itkk.udf.api.rbac.auth.CommonHandlerInterceptor;
import org.itkk.udf.api.rbac.auth.WebHandlerInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
@@ -19,12 +18,6 @@ public class RbacConfiguration implements WebMvcConfigurer {
@Autowired
private WebHandlerInterceptor webHandlerInterceptor;
/**
* commonHandlerInterceptor
*/
@Autowired
private CommonHandlerInterceptor commonHandlerInterceptor;
/**
* 添加拦截器
*
@@ -32,7 +25,6 @@ public class RbacConfiguration implements WebMvcConfigurer {
*/
@Override
public void addInterceptors(InterceptorRegistry registry) {
registry.addInterceptor(commonHandlerInterceptor).order(1).addPathPatterns("/**");
registry.addInterceptor(webHandlerInterceptor).order(2).addPathPatterns(CommonConstant.URL_ROOT_WEB_PRIVATE + "**");
registry.addInterceptor(webHandlerInterceptor).order(1).addPathPatterns(CommonConstant.URL_ROOT_WEB_PRIVATE + "**");
}
}
+5
View File
@@ -30,6 +30,11 @@
<groupId>org.itkk.udf</groupId>
<artifactId>udf-api-rbac</artifactId>
</dependency>
<!--udf-api-page-->
<dependency>
<groupId>org.itkk.udf</groupId>
<artifactId>udf-api-page</artifactId>
</dependency>
</dependencies>
<!-- 构建 -->
<build>