Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Y
yudao-cloud
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
hblj
yudao-cloud
Commits
a6d07fed
提交
a6d07fed
authored
3月 10, 2019
作者:
YunaiV
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
User 模块,引入 Admin 认证授权~
上级
1afea13f
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
16 行增加
和
5 行删除
+16
-5
.gitignore
.gitignore
+1
-2
CommonResult.java
...ain/java/cn/iocoder/common/framework/vo/CommonResult.java
+3
-1
pom.xml
user/user-application/pom.xml
+6
-0
MVCConfiguration.java
...ocoder/mall/user/application/config/MVCConfiguration.java
+6
-2
没有找到文件。
.gitignore
浏览文件 @
a6d07fed
...
@@ -18,9 +18,8 @@
...
@@ -18,9 +18,8 @@
*.iws
*.iws
*.iml
*.iml
*.ipr
*.ipr
target/*
target/*
*.class
*.class
target/*
### NetBeans ###
### NetBeans ###
/nbproject/private/
/nbproject/private/
...
...
common/common-framework/src/main/java/cn/iocoder/common/framework/vo/CommonResult.java
浏览文件 @
a6d07fed
...
@@ -3,7 +3,9 @@ package cn.iocoder.common.framework.vo;
...
@@ -3,7 +3,9 @@ package cn.iocoder.common.framework.vo;
import
com.fasterxml.jackson.annotation.JsonIgnore
;
import
com.fasterxml.jackson.annotation.JsonIgnore
;
import
org.springframework.util.Assert
;
import
org.springframework.util.Assert
;
public
class
CommonResult
<
T
>
{
import
java.io.Serializable
;
public
class
CommonResult
<
T
>
implements
Serializable
{
public
static
Integer
CODE_SUCCESS
=
0
;
public
static
Integer
CODE_SUCCESS
=
0
;
...
...
user/user-application/pom.xml
浏览文件 @
a6d07fed
...
@@ -92,6 +92,12 @@
...
@@ -92,6 +92,12 @@
<scope>
compile
</scope>
<scope>
compile
</scope>
</dependency>
</dependency>
<dependency>
<groupId>
cn.iocoder.mall
</groupId>
<artifactId>
admin-sdk
</artifactId>
<version>
1.0-SNAPSHOT
</version>
</dependency>
<dependency>
<dependency>
<groupId>
org.mapstruct
</groupId>
<groupId>
org.mapstruct
</groupId>
<artifactId>
mapstruct
</artifactId>
<!-- use mapstruct-jdk8 for Java 8 or higher -->
<artifactId>
mapstruct
</artifactId>
<!-- use mapstruct-jdk8 for Java 8 or higher -->
...
...
user/user-application/src/main/java/cn/iocoder/mall/user/application/config/MVCConfiguration.java
浏览文件 @
a6d07fed
package
cn
.
iocoder
.
mall
.
user
.
application
.
config
;
package
cn
.
iocoder
.
mall
.
user
.
application
.
config
;
import
cn.iocoder.common.framework.config.GlobalExceptionHandler
;
import
cn.iocoder.common.framework.config.GlobalExceptionHandler
;
import
cn.iocoder.mall.admin.sdk.interceptor.AdminSecurityInterceptor
;
import
cn.iocoder.mall.user.sdk.interceptor.UserSecurityInterceptor
;
import
cn.iocoder.mall.user.sdk.interceptor.UserSecurityInterceptor
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Configuration
;
...
@@ -13,15 +14,18 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
...
@@ -13,15 +14,18 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@EnableWebMvc
@EnableWebMvc
@Configuration
@Configuration
@Import
(
value
=
{
GlobalExceptionHandler
.
class
,
// 统一全局返回
@Import
(
value
=
{
GlobalExceptionHandler
.
class
,
// 统一全局返回
UserSecurityInterceptor
.
class
})
// 安全拦截器,实现认证和授权功能。
UserSecurityInterceptor
.
class
,
AdminSecurityInterceptor
.
class
})
// 安全拦截器,实现认证和授权功能。
public
class
MVCConfiguration
implements
WebMvcConfigurer
{
public
class
MVCConfiguration
implements
WebMvcConfigurer
{
@Autowired
@Autowired
private
UserSecurityInterceptor
securityInterceptor
;
private
UserSecurityInterceptor
securityInterceptor
;
@Autowired
private
AdminSecurityInterceptor
adminSecurityInterceptor
;
@Override
@Override
public
void
addInterceptors
(
InterceptorRegistry
registry
)
{
public
void
addInterceptors
(
InterceptorRegistry
registry
)
{
registry
.
addInterceptor
(
securityInterceptor
).
addPathPatterns
(
"/user/**"
,
"/admin/**"
);
// 只拦截我们定义的接口
registry
.
addInterceptor
(
securityInterceptor
).
addPathPatterns
(
"/users/**"
);
// 只拦截我们定义的接口
registry
.
addInterceptor
(
adminSecurityInterceptor
).
addPathPatterns
(
"/admins/**"
);
// 只拦截我们定义的接口
}
}
@Override
@Override
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论