Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
JAVA小学生-王铁柱
eladmin
提交
94946018
E
eladmin
项目概览
JAVA小学生-王铁柱
/
eladmin
与 Fork 源项目一致
从无法访问的项目Fork
通知
4
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
E
eladmin
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
94946018
编写于
5月 29, 2019
作者:
Z
zhengjie
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update LogQueryService
上级
c2155c42
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
11 addition
and
12 deletion
+11
-12
eladmin-logging/src/main/java/me/zhengjie/rest/LogController.java
...logging/src/main/java/me/zhengjie/rest/LogController.java
+1
-1
eladmin-logging/src/main/java/me/zhengjie/service/query/LogQueryService.java
.../main/java/me/zhengjie/service/query/LogQueryService.java
+6
-4
eladmin-system/src/main/java/me/zhengjie/modules/security/config/SecurityConfig.java
...a/me/zhengjie/modules/security/config/SecurityConfig.java
+4
-4
eladmin-system/src/main/java/me/zhengjie/modules/system/rest/UserController.java
.../java/me/zhengjie/modules/system/rest/UserController.java
+0
-3
未找到文件。
eladmin-logging/src/main/java/me/zhengjie/rest/LogController.java
浏览文件 @
94946018
...
...
@@ -39,7 +39,7 @@ public class LogController {
public
ResponseEntity
getUserLogs
(
Log
log
,
Pageable
pageable
){
log
.
setLogType
(
"INFO"
);
log
.
setUsername
(
SecurityUtils
.
getUsername
());
return
new
ResponseEntity
(
logQueryService
.
queryAll
(
log
,
pageable
),
HttpStatus
.
OK
);
return
new
ResponseEntity
(
logQueryService
.
queryAll
ByUser
(
log
,
pageable
),
HttpStatus
.
OK
);
}
@GetMapping
(
value
=
"/logs/error"
)
...
...
eladmin-logging/src/main/java/me/zhengjie/service/query/LogQueryService.java
浏览文件 @
94946018
...
...
@@ -40,13 +40,15 @@ public class LogQueryService {
public
Object
queryAll
(
Log
log
,
Pageable
pageable
){
Page
<
Log
>
page
=
logRepository
.
findAll
(
new
Spec
(
log
),
pageable
);
if
(!
ObjectUtils
.
isEmpty
(
log
.
getUsername
()))
{
return
PageUtil
.
toPage
(
page
.
map
(
logSmallMapper:
:
toDto
));
}
if
(
log
.
getLogType
().
equals
(
"ERROR"
))
{
return
PageUtil
.
toPage
(
page
.
map
(
logErrorMapper:
:
toDto
));
}
return
logRepository
.
findAll
(
new
Spec
(
log
),
pageable
);
return
page
;
}
public
Object
queryAllByUser
(
Log
log
,
Pageable
pageable
)
{
Page
<
Log
>
page
=
logRepository
.
findAll
(
new
Spec
(
log
),
pageable
);
return
PageUtil
.
toPage
(
page
.
map
(
logSmallMapper:
:
toDto
));
}
class
Spec
implements
Specification
<
Log
>
{
...
...
eladmin-system/src/main/java/me/zhengjie/modules/security/config/SecurityConfig.java
浏览文件 @
94946018
...
...
@@ -89,10 +89,10 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
"/**/*.html"
,
"/**/*.css"
,
"/**/*.js"
).
permitAll
()
).
anonymous
()
.
antMatchers
(
HttpMethod
.
POST
,
"/auth/"
+
loginPath
).
permitAll
()
.
antMatchers
(
"/websocket/**"
).
permitAll
()
.
antMatchers
(
HttpMethod
.
POST
,
"/auth/"
+
loginPath
).
anonymous
()
.
antMatchers
(
"/websocket/**"
).
anonymous
()
// 支付宝回调
.
antMatchers
(
"/api/aliPay/return"
).
anonymous
()
.
antMatchers
(
"/api/aliPay/notify"
).
anonymous
()
...
...
@@ -111,7 +111,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
.
antMatchers
(
"/test/**"
).
anonymous
()
.
antMatchers
(
HttpMethod
.
OPTIONS
,
"/**"
).
anonymous
()
.
antMatchers
(
"/druid/**"
).
permitAll
()
.
antMatchers
(
"/druid/**"
).
anonymous
()
// 所有请求都需要认证
.
anyRequest
().
authenticated
()
// 防止iframe 造成跨域
...
...
eladmin-system/src/main/java/me/zhengjie/modules/system/rest/UserController.java
浏览文件 @
94946018
...
...
@@ -100,9 +100,6 @@ public class UserController {
@PostMapping
(
value
=
"/users"
)
@PreAuthorize
(
"hasAnyRole('ADMIN','USER_ALL','USER_CREATE')"
)
public
ResponseEntity
create
(
@Validated
@RequestBody
User
resources
){
if
(
resources
.
getId
()
!=
null
)
{
throw
new
BadRequestException
(
"A new "
+
ENTITY_NAME
+
" cannot already have an ID"
);
}
checkLevel
(
resources
);
return
new
ResponseEntity
(
userService
.
create
(
resources
),
HttpStatus
.
CREATED
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录