Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
Y
yifu-mvp
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fangxinjiang
yifu-mvp
Commits
19d4ed04
Commit
19d4ed04
authored
Jun 08, 2022
by
fangxinjiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
配置调整
parent
7c3cc077
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
133 additions
and
15 deletions
+133
-15
SysLogDTO.java
.../com/yifu.cloud.plus.v1/yifu/admin/api/dto/SysLogDTO.java
+5
-0
RoleController.java
...u.cloud.plus.v1/yifu/admin/controller/RoleController.java
+2
-2
SysRoleService.java
...yifu.cloud.plus.v1/yifu/admin/service/SysRoleService.java
+2
-0
SysLogServiceImpl.java
...ud.plus.v1/yifu/admin/service/impl/SysLogServiceImpl.java
+3
-1
SysRoleServiceImpl.java
...d.plus.v1/yifu/admin/service/impl/SysRoleServiceImpl.java
+23
-0
pom.xml
yifu-visual/yifu-codegen/pom.xml
+4
-4
YifuCodeGenApplication.java
...fu.cloud.plus.v1/yifu/codegen/YifuCodeGenApplication.java
+1
-2
application.yml
yifu-visual/yifu-codegen/src/main/resources/application.yml
+18
-2
pom.xml
yifu-visual/yifu-sentinel-dashboard/pom.xml
+11
-1
AuthController.java
...aba/csp/sentinel/dashboard/controller/AuthController.java
+64
-3
No files found.
yifu-upms/yifu-upms-api/src/main/java/com/yifu.cloud.plus.v1/yifu/admin/api/dto/SysLogDTO.java
View file @
19d4ed04
...
...
@@ -26,5 +26,10 @@ public class SysLogDTO {
*/
@Schema
(
description
=
"创建时间区间"
)
private
LocalDateTime
[]
createTime
;
/**
* 日志标题
*/
@Schema
(
description
=
"日志标题"
)
private
String
title
;
}
yifu-upms/yifu-upms-biz/src/main/java/com/yifu.cloud.plus.v1/yifu/admin/controller/RoleController.java
View file @
19d4ed04
...
...
@@ -115,8 +115,8 @@ public class RoleController {
* @return 分页对象
*/
@GetMapping
(
"/page"
)
public
R
<
IPage
<
SysRole
>>
getRolePage
(
Page
page
)
{
return
R
.
ok
(
sysRoleService
.
page
(
page
,
Wrappers
.
emptyWrapper
()
));
public
R
<
IPage
<
SysRole
>>
getRolePage
(
Page
page
,
SysRole
sysRole
)
{
return
R
.
ok
(
sysRoleService
.
getSysRoleByPage
(
page
,
sysRole
));
}
/**
...
...
yifu-upms/yifu-upms-biz/src/main/java/com/yifu.cloud.plus.v1/yifu/admin/service/SysRoleService.java
View file @
19d4ed04
...
...
@@ -16,6 +16,7 @@
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
admin
.
service
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysRole
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.vo.RoleExcelVO
;
...
...
@@ -55,4 +56,5 @@ public interface SysRoleService extends IService<SysRole> {
*/
List
<
RoleExcelVO
>
listRole
();
Page
<
SysRole
>
getSysRoleByPage
(
Page
page
,
SysRole
sysRole
);
}
yifu-upms/yifu-upms-biz/src/main/java/com/yifu.cloud.plus.v1/yifu/admin/service/impl/SysLogServiceImpl.java
View file @
19d4ed04
...
...
@@ -66,7 +66,9 @@ public class SysLogServiceImpl extends ServiceImpl<SysLogMapper, SysLog> impleme
if
(
StrUtil
.
isNotBlank
(
sysLog
.
getType
()))
{
wrapper
.
eq
(
SysLog:
:
getType
,
sysLog
.
getType
());
}
if
(
StrUtil
.
isNotBlank
(
sysLog
.
getTitle
())){
wrapper
.
likeRight
(
SysLog:
:
getTitle
,
sysLog
.
getTitle
());
}
if
(
ArrayUtil
.
isNotEmpty
(
sysLog
.
getCreateTime
()))
{
wrapper
.
ge
(
SysLog:
:
getCreateTime
,
sysLog
.
getCreateTime
()[
0
]).
le
(
SysLog:
:
getCreateTime
,
sysLog
.
getCreateTime
()[
1
]);
...
...
yifu-upms/yifu-upms-biz/src/main/java/com/yifu.cloud.plus.v1/yifu/admin/service/impl/SysRoleServiceImpl.java
View file @
19d4ed04
...
...
@@ -18,8 +18,14 @@ package com.yifu.cloud.plus.v1.yifu.admin.service.impl;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.collection.CollUtil
;
import
cn.hutool.core.util.ArrayUtil
;
import
cn.hutool.core.util.StrUtil
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.dto.SysLogDTO
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysLog
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysRole
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysRoleMenu
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.vo.RoleExcelVO
;
...
...
@@ -126,6 +132,23 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> impl
}).
collect
(
Collectors
.
toList
());
}
@Override
public
Page
<
SysRole
>
getSysRoleByPage
(
Page
page
,
SysRole
sysRole
)
{
return
baseMapper
.
selectPage
(
page
,
buildQueryWrapper
(
sysRole
));
}
/**
* 构建查询的 wrapper
* @param sysRole 查询条件
* @return LambdaQueryWrapper
*/
private
LambdaQueryWrapper
buildQueryWrapper
(
SysRole
sysRole
)
{
LambdaQueryWrapper
<
SysRole
>
wrapper
=
Wrappers
.
lambdaQuery
();
if
(
StrUtil
.
isNotBlank
(
sysRole
.
getRoleName
())){
wrapper
.
likeRight
(
SysRole:
:
getRoleName
,
sysRole
.
getRoleName
());
}
return
wrapper
;
}
/**
* 插入excel Role
*/
...
...
yifu-visual/yifu-codegen/pom.xml
View file @
19d4ed04
...
...
@@ -37,15 +37,15 @@
<artifactId>yifu-common-swagger</artifactId>
</dependency>-->
<!--注册中心客户端-->
<dependency>
<
!--<
dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
</dependency>
</dependency>
-->
<!--配置中心客户端-->
<dependency>
<
!--<
dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
</dependency>
</dependency>
-->
<!--断路器依赖-->
<!--<dependency>
<groupId>com.yifu.cloud.plus.v1</groupId>
...
...
yifu-visual/yifu-codegen/src/main/java/com/yifu.cloud.plus.v1/yifu/codegen/YifuCodeGenApplication.java
View file @
19d4ed04
...
...
@@ -20,7 +20,6 @@ import com.yifu.cloud.plus.v1.yifu.common.datasource.annotation.EnableDynamicDat
import
com.yifu.cloud.plus.v1.yifu.common.security.annotation.EnableYifuResourceServer
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.cloud.client.discovery.EnableDiscoveryClient
;
/**
* @author lengleng
...
...
@@ -29,7 +28,7 @@ import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
//@EnableYifuDoc
@EnableDynamicDataSource
//@EnableYifuFeignClients
@EnableDiscoveryClient
//
@EnableDiscoveryClient
@SpringBootApplication
@EnableYifuResourceServer
public
class
YifuCodeGenApplication
{
...
...
yifu-visual/yifu-codegen/src/main/resources/application.yml
View file @
19d4ed04
# 加解密根密码
jasypt
:
encryptor
:
password
:
pig
#根密码
## spring security 配置
security
:
oauth2
:
...
...
@@ -5,14 +9,26 @@ security:
client-id
:
ENC(27v1agvAug87ANOVnbKdsw==)
client-secret
:
ENC(VbnkopxrwgbFVKp+UxJ2pg==)
scope
:
server
resource
:
loadBalanced
:
true
token-info-uri
:
http://yifu-auth/oauth/check_token
ignore
:
# 通用放行URL,服务个性化,请在对应配置文件覆盖
urls
:
-
/v3/api-docs
-
/actuator/**
# 数据源配置
spring
:
config
:
activate
:
on-profile
:
dev
redis
:
host
:
127.0.0.1
password
:
'
@yf_2017'
datasource
:
type
:
com.zaxxer.hikari.HikariDataSource
driver-class-name
:
com.mysql.cj.jdbc.Driver
username
:
root
password
:
u
f_zsk
password
:
y
f_zsk
url
:
jdbc:mysql://192.168.1.65:22306/yifu_codegen?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
web
:
resources
:
...
...
yifu-visual/yifu-sentinel-dashboard/pom.xml
View file @
19d4ed04
...
...
@@ -74,6 +74,16 @@
<artifactId>
httpcore-nio
</artifactId>
<version>
4.4.6
</version>
</dependency>
<dependency>
<groupId>
com.yifu.cloud.plus.v1
</groupId>
<artifactId>
yifu-common-core
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.security.oauth
</groupId>
<artifactId>
spring-security-oauth2
</artifactId>
<version>
2.3.5.RELEASE
</version>
<scope>
compile
</scope>
</dependency>
</dependencies>
<build>
...
...
yifu-visual/yifu-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/controller/AuthController.java
View file @
19d4ed04
...
...
@@ -15,18 +15,30 @@
*/
package
com
.
alibaba
.
csp
.
sentinel
.
dashboard
.
controller
;
import
cn.hutool.core.util.StrUtil
;
import
com.alibaba.csp.sentinel.dashboard.auth.AuthService
;
import
com.alibaba.csp.sentinel.dashboard.auth.SimpleWebAuthServiceImpl
;
import
com.alibaba.csp.sentinel.dashboard.config.DashboardConfig
;
import
com.alibaba.csp.sentinel.dashboard.domain.Result
;
import
com.google.common.net.HttpHeaders
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.SpringContextHolder
;
import
lombok.RequiredArgsConstructor
;
import
org.apache.commons.lang.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.cache.CacheManager
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.security.authentication.event.LogoutSuccessEvent
;
import
org.springframework.security.oauth2.common.OAuth2AccessToken
;
import
org.springframework.security.oauth2.common.OAuth2RefreshToken
;
import
org.springframework.security.oauth2.provider.ClientDetailsService
;
import
org.springframework.security.oauth2.provider.OAuth2Authentication
;
import
org.springframework.security.oauth2.provider.token.TokenStore
;
import
org.springframework.web.bind.annotation.*
;
import
javax.servlet.http.HttpServletRequest
;
...
...
@@ -34,10 +46,19 @@ import javax.servlet.http.HttpServletRequest;
* @author cdfive
* @since 1.6.0
*/
@RequiredArgsConstructor
@RestController
@RequestMapping
(
"/auth"
)
public
class
AuthController
{
private
final
ClientDetailsService
clientDetailsService
;
private
final
TokenStore
tokenStore
;
private
final
RedisTemplate
redisTemplate
;
private
final
CacheManager
cacheManager
;
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
AuthController
.
class
);
@Value
(
"${auth.username:sentinel}"
)
...
...
@@ -91,4 +112,44 @@ public class AuthController {
return
Result
.
ofSuccess
(
authUser
);
}
/* *//**
* 退出并删除token
* @param authHeader Authorization
*//*
@DeleteMapping("/logout")
public R<Boolean> logout(@RequestHeader(value = HttpHeaders.AUTHORIZATION, required = false) String authHeader) {
if (StrUtil.isBlank(authHeader)) {
return R.ok();
}
String tokenValue = authHeader.replace(OAuth2AccessToken.BEARER_TYPE, StrUtil.EMPTY).trim();
return removeToken(tokenValue);
}
*//**
* 令牌管理调用
* @param token token
*//*
@DeleteMapping("/{token}")
public R<Boolean> removeToken(@PathVariable("token") String token) {
OAuth2AccessToken accessToken = tokenStore.readAccessToken(token);
if (accessToken == null || StrUtil.isBlank(accessToken.getValue())) {
return R.ok();
}
OAuth2Authentication auth2Authentication = tokenStore.readAuthentication(accessToken);
// 清空用户信息
cacheManager.getCache(CacheConstants.USER_DETAILS).evict(auth2Authentication.getName());
// 清空access token
tokenStore.removeAccessToken(accessToken);
// 清空 refresh token
OAuth2RefreshToken refreshToken = accessToken.getRefreshToken();
tokenStore.removeRefreshToken(refreshToken);
// 处理自定义退出事件,保存相关日志
SpringContextHolder.publishEvent(new LogoutSuccessEvent(auth2Authentication));
return R.ok();
}*/
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment