Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
iBiz4j Spring R7
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
iBiz-R7后台标准模板
iBiz4j Spring R7
提交
3ccec3a6
提交
3ccec3a6
编写于
5月 06, 2020
作者:
sq3536
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
bpmn
上级
9095a26c
变更
5
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
18 行增加
和
1 行删除
+18
-1
%APP%SecurityConfig.java.ftl
...KGPATH%/%APP_PKGPATH%/config/%APP%SecurityConfig.java.ftl
+4
-0
DevBootSecurityConfig.java.ftl
.../java/%SYS_PKGPATH%/config/DevBootSecurityConfig.java.ftl
+4
-0
%API%SecurityConfig.java.ftl
...ATH%/%SYSAPI_PKGPATH%/config/%API%SecurityConfig.java.ftl
+4
-0
AuthenticationController.java.ftl
...%SYS_PKGPATH%/util/rest/AuthenticationController.java.ftl
+4
-0
AuthorizationTokenFilter.java.ftl
..._PKGPATH%/util/security/AuthorizationTokenFilter.java.ftl
+2
-1
未找到文件。
SLN/%PUBPRJ%-app/%PUBPRJ%-app-%APP_PKGPATH%/src/main/java/%SYS_PKGPATH%/%APP_PKGPATH%/config/%APP%SecurityConfig.java.ftl
浏览文件 @
3ccec3a6
...
...
@@ -23,6 +23,7 @@ import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import
org
.
springframework
.
security
.
crypto
.
password
.
PasswordEncoder
;
import
org
.
springframework
.
security
.
web
.
authentication
.
UsernamePasswordAuthenticationFilter
;
import
org
.
springframework
.
context
.
annotation
.
Profile
;
import
org
.
springframework
.
beans
.
factory
.
annotation
.
Qualifier
;
@
Profile
(
"${app.getPKGCodeName()?lower_case}-prod"
)
@
Configuration
...
...
@@ -33,6 +34,9 @@ public class ${app.getPKGCodeName()}SecurityConfig extends WebSecurityConfigurer
private
AuthenticationEntryPoint
unauthorizedHandler
;
@
Autowired
<#
if
sys
.
getPSSystemSetting
()??
&&
sys
.
getPSSystemSetting
().
getDataAccCtrlArch
()??
&&
sys
.
getPSSystemSetting
().
getDataAccCtrlArch
()==
1
>
@
Qualifier
(
"IBZUAAUserService"
)
</#
if
>
private
AuthenticationUserService
userDetailsService
;
/**
...
...
SLN/%PUBPRJ%-boot/src/main/java/%SYS_PKGPATH%/config/DevBootSecurityConfig.java.ftl
浏览文件 @
3ccec3a6
...
...
@@ -22,6 +22,7 @@ import org.springframework.security.config.http.SessionCreationPolicy;
import
org
.
springframework
.
security
.
crypto
.
bcrypt
.
BCryptPasswordEncoder
;
import
org
.
springframework
.
security
.
crypto
.
password
.
PasswordEncoder
;
import
org
.
springframework
.
security
.
web
.
authentication
.
UsernamePasswordAuthenticationFilter
;
import
org
.
springframework
.
beans
.
factory
.
annotation
.
Qualifier
;
@
Configuration
@
EnableWebSecurity
...
...
@@ -32,6 +33,9 @@ public class DevBootSecurityConfig extends WebSecurityConfigurerAdapter {
private
AuthenticationEntryPoint
unauthorizedHandler
;
@
Autowired
<#
if
sys
.
getPSSystemSetting
()??
&&
sys
.
getPSSystemSetting
().
getDataAccCtrlArch
()??
&&
sys
.
getPSSystemSetting
().
getDataAccCtrlArch
()==
1
>
@
Qualifier
(
"IBZUAAUserService"
)
</#
if
>
private
AuthenticationUserService
userDetailsService
;
/**
...
...
SLN/%PUBPRJ%-provider/%PUBPRJ%-provider-%SYSAPI_PKGPATH%/src/main/java/%SYS_PKGPATH%/%SYSAPI_PKGPATH%/config/%API%SecurityConfig.java.ftl
浏览文件 @
3ccec3a6
...
...
@@ -23,6 +23,7 @@ import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import
org
.
springframework
.
security
.
crypto
.
password
.
PasswordEncoder
;
import
org
.
springframework
.
security
.
web
.
authentication
.
UsernamePasswordAuthenticationFilter
;
import
org
.
springframework
.
context
.
annotation
.
Profile
;
import
org
.
springframework
.
beans
.
factory
.
annotation
.
Qualifier
;
@
Profile
(
"${item.getCodeName()?lower_case}-prod"
)
@
Configuration
...
...
@@ -33,6 +34,9 @@ public class ${item.codeName}SecurityConfig extends WebSecurityConfigurerAdapter
private
AuthenticationEntryPoint
unauthorizedHandler
;
@
Autowired
<#
if
sys
.
getPSSystemSetting
()??
&&
sys
.
getPSSystemSetting
().
getDataAccCtrlArch
()??
&&
sys
.
getPSSystemSetting
().
getDataAccCtrlArch
()==
1
>
@
Qualifier
(
"IBZUAAUserService"
)
</#
if
>
private
AuthenticationUserService
userDetailsService
;
/**
...
...
SLN/%PUBPRJ%-util/src/main/java/%SYS_PKGPATH%/util/rest/AuthenticationController.java.ftl
浏览文件 @
3ccec3a6
...
...
@@ -17,6 +17,7 @@ import org.springframework.security.core.context.SecurityContextHolder;
import
org
.
springframework
.
security
.
core
.
userdetails
.
UserDetails
;
import
org
.
springframework
.
validation
.
annotation
.
Validated
;
import
org
.
springframework
.
web
.
bind
.
annotation
.*;
import
org
.
springframework
.
beans
.
factory
.
annotation
.
Qualifier
;
@
RestController
@
RequestMapping
(
"/"
)
...
...
@@ -30,6 +31,9 @@ public class AuthenticationController
private
AuthTokenUtil
jwtTokenUtil
;
@
Autowired
<#
if
sys
.
getPSSystemSetting
()??
&&
sys
.
getPSSystemSetting
().
getDataAccCtrlArch
()??
&&
sys
.
getPSSystemSetting
().
getDataAccCtrlArch
()==
1
>
@
Qualifier
(
"IBZUAAUserService"
)
</#
if
>
private
AuthenticationUserService
userDetailsService
;
@
PostMapping
(
value
=
${
r
'"${ibiz.auth.path:v7/login}"'
})
...
...
SLN/%PUBPRJ%-util/src/main/java/%SYS_PKGPATH%/util/security/AuthorizationTokenFilter.java.ftl
浏览文件 @
3ccec3a6
...
...
@@ -14,6 +14,7 @@ import org.springframework.security.core.userdetails.UserDetailsService;
import
org
.
springframework
.
security
.
web
.
authentication
.
WebAuthenticationDetailsSource
;
import
org
.
springframework
.
stereotype
.
Component
;
import
org
.
springframework
.
web
.
filter
.
OncePerRequestFilter
;
import
org
.
springframework
.
beans
.
factory
.
annotation
.
Qualifier
;
import
javax
.
servlet
.
FilterChain
;
import
javax
.
servlet
.
ServletException
;
...
...
@@ -29,7 +30,7 @@ public class AuthorizationTokenFilter extends OncePerRequestFilter {
private
final
AuthTokenUtil
authTokenUtil
;
private
final
String
tokenHeader
;
public
AuthorizationTokenFilter
(
AuthenticationUserService
userDetailsService
,
AuthTokenUtil
authTokenUtil
,
@
Value
(${
r
'"${ibiz.jwt.header:Authorization}"'
})
String
tokenHeader
)
{
public
AuthorizationTokenFilter
(
<#
if
sys
.
getPSSystemSetting
()??
&&
sys
.
getPSSystemSetting
().
getDataAccCtrlArch
()??
&&
sys
.
getPSSystemSetting
().
getDataAccCtrlArch
()==
1
>@
Qualifier
(
"IBZUAAUserService"
)</#
if
>
AuthenticationUserService
userDetailsService
,
AuthTokenUtil
authTokenUtil
,
@
Value
(${
r
'"${ibiz.jwt.header:Authorization}"'
})
String
tokenHeader
)
{
this
.
userDetailsService
=
userDetailsService
;
this
.
authTokenUtil
=
authTokenUtil
;
this
.
tokenHeader
=
tokenHeader
;
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录