@@ -32,6 +32,18 @@ | |||
<scope>test</scope> | |||
</dependency> | |||
<!--任务调度--> | |||
<dependency> | |||
<groupId>com.xuxueli</groupId> | |||
<artifactId>xxl-job-core</artifactId> | |||
<version>2.3.0</version> | |||
</dependency> | |||
<dependency> | |||
<groupId>com.drewnoakes</groupId> | |||
<artifactId>metadata-extractor</artifactId> | |||
<version>2.6.2</version> | |||
</dependency> | |||
<dependency> | |||
<groupId>com.baomidou</groupId> | |||
<artifactId>mybatis-plus-boot-starter</artifactId> |
@@ -0,0 +1,86 @@ | |||
package com.tuoheng.config; | |||
import com.xxl.job.core.executor.impl.XxlJobSpringExecutor; | |||
import org.slf4j.Logger; | |||
import org.slf4j.LoggerFactory; | |||
import org.springframework.beans.factory.annotation.Value; | |||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; | |||
import org.springframework.context.annotation.Bean; | |||
import org.springframework.context.annotation.Configuration; | |||
/** | |||
* xxl-job config | |||
* | |||
* @author xuxueli 2017-04-28 | |||
*/ | |||
@Configuration | |||
@ConditionalOnProperty(name = XxlJobConfig.XXL_ENABLE, havingValue = XxlJobConfig.TRUE) | |||
public class XxlJobConfig { | |||
public static final String XXL_ENABLE = "xxl.enable"; | |||
public static final String TRUE = "true"; | |||
private Logger logger = LoggerFactory.getLogger(XxlJobConfig.class); | |||
@Value("${xxl.job.admin.addresses}") | |||
private String adminAddresses; | |||
@Value("${xxl.job.accessToken}") | |||
private String accessToken; | |||
@Value("${xxl.job.executor.appname}") | |||
private String appname; | |||
@Value("${xxl.job.executor.address}") | |||
private String address; | |||
@Value("${xxl.job.executor.ip}") | |||
private String ip; | |||
@Value("${xxl.job.executor.port}") | |||
private int port; | |||
@Value("${xxl.job.executor.logpath}") | |||
private String logPath; | |||
@Value("${xxl.job.executor.logretentiondays}") | |||
private int logRetentionDays; | |||
@Bean | |||
public XxlJobSpringExecutor xxlJobExecutor() throws InterruptedException { | |||
logger.info(">>>>>>>>>>> xxl-job config init."); | |||
Thread.sleep(5000); | |||
XxlJobSpringExecutor xxlJobSpringExecutor = new XxlJobSpringExecutor(); | |||
xxlJobSpringExecutor.setAdminAddresses(adminAddresses); | |||
xxlJobSpringExecutor.setAppname(appname); | |||
xxlJobSpringExecutor.setAddress(address); | |||
xxlJobSpringExecutor.setIp(ip); | |||
xxlJobSpringExecutor.setPort(port); | |||
xxlJobSpringExecutor.setAccessToken(accessToken); | |||
xxlJobSpringExecutor.setLogPath(logPath); | |||
xxlJobSpringExecutor.setLogRetentionDays(logRetentionDays); | |||
return xxlJobSpringExecutor; | |||
} | |||
/** | |||
* 针对多网卡、容器内部署等情况,可借助 "spring-cloud-commons" 提供的 "InetUtils" 组件灵活定制注册IP; | |||
* | |||
* 1、引入依赖: | |||
* <dependency> | |||
* <groupId>org.springframework.cloud</groupId> | |||
* <artifactId>spring-cloud-commons</artifactId> | |||
* <version>${version}</version> | |||
* </dependency> | |||
* | |||
* 2、配置文件,或者容器启动变量 | |||
* spring.cloud.inetutils.preferred-networks: 'xxx.xxx.xxx.' | |||
* | |||
* 3、获取IP | |||
* String ip_ = inetUtils.findFirstNonLoopbackHostInfo().getIpAddress(); | |||
*/ | |||
} |
@@ -58,6 +58,4 @@ public class TenantPo extends BasePo { | |||
private String lng; | |||
private String lat; | |||
private Integer status; | |||
} |
@@ -28,4 +28,10 @@ public class UserPo extends BasePo { | |||
*/ | |||
private Integer roleId; | |||
private Integer isAble; | |||
private Integer isExpire; | |||
} |
@@ -46,6 +46,11 @@ public class TenantVo { | |||
*市区编号 | |||
*/ | |||
private String cityCode; | |||
/** | |||
* 1 正常 0禁用 | |||
*/ | |||
private Integer status; | |||
/** | |||
* 市区名称 | |||
*/ | |||
@@ -73,10 +78,6 @@ public class TenantVo { | |||
private Date updateTime; | |||
private Long userId; | |||
/** | |||
* 1,启用 0禁用 | |||
*/ | |||
private Integer status; | |||
/** | |||
* 客户联系人 | |||
*/ |
@@ -501,11 +501,14 @@ public class TenantServiceImpl implements TenantService { | |||
} | |||
UserPo userPo = clientUserMapper.selectByUserId(tenantPo.getUserId()); | |||
//1正常 0禁用 | |||
userPo.setEnabled(dto.getStatus()); | |||
userPo.setIsAble(dto.getStatus()); | |||
clientUserMapper.updatePass(userPo); | |||
tenantPo.setStatus(dto.getStatus()); | |||
tenantMapper.updateById(tenantPo); | |||
//租户更新完毕 更新对应租户下的用户 | |||
List<UserPo> userPoList = clientUserMapper.selectByTenantId(userPo.getId()); | |||
for (UserPo po : userPoList) { | |||
po.setIsExpire(dto.getStatus()); | |||
clientUserMapper.updatePass(userPo); | |||
} | |||
return JsonResult.success(); | |||
} | |||
@@ -0,0 +1,68 @@ | |||
package com.tuoheng.task; | |||
import cn.hutool.core.date.DateTime; | |||
import cn.hutool.core.date.DateUtil; | |||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |||
import com.tuoheng.mapper.ClientUserMapper; | |||
import com.tuoheng.mapper.ClientUserRoleMapper; | |||
import com.tuoheng.mapper.TenantItemMapper; | |||
import com.tuoheng.mapper.TenantMapper; | |||
import com.tuoheng.model.entity.TenantItem; | |||
import com.tuoheng.model.po.TenantPo; | |||
import com.tuoheng.model.po.UserPo; | |||
import com.xxl.job.core.handler.annotation.XxlJob; | |||
import lombok.extern.slf4j.Slf4j; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.stereotype.Component; | |||
import java.util.List; | |||
/** | |||
* 定时监控系统到期时间并修改 | |||
* | |||
* @Author xiaoying | |||
* @Date 2023/6/30 10:36 | |||
*/ | |||
@Component | |||
@Slf4j | |||
public class StatusTask { | |||
@Autowired | |||
private TenantItemMapper tenantItemMapper; | |||
@Autowired | |||
private TenantMapper tenantMapper; | |||
@Autowired | |||
private ClientUserMapper clientUserMapper; | |||
@XxlJob("statusTask") | |||
public void statusTask() { | |||
//获取所有租户对应系统的过期时间 | |||
log.info("定时任务开始"); | |||
List<TenantItem> tenantItems = tenantItemMapper.selectList(Wrappers.<TenantItem>lambdaQuery()); | |||
for (TenantItem tenantItem : tenantItems) { | |||
//当前时间与项目结束时间进行对比 | |||
DateTime date = DateUtil.date(); | |||
//判断项目是否已过有效期 | |||
boolean falg = date.after(tenantItem.getEndTime()); | |||
if (falg) { | |||
//过了则更新租户对应项目状态 | |||
TenantPo tenantPo = tenantMapper.selectById(tenantItem.getTenantId()); | |||
UserPo userPo = clientUserMapper.selectByUserId(tenantPo.getUserId()); | |||
if (0 != userPo.getIsExpire()) { | |||
log.info("开始禁用对应租户及其用户状态,对应租户id:{}", tenantItem.getTenantId()); | |||
userPo.setIsExpire(0); | |||
//租户状态完毕 | |||
clientUserMapper.updatePass(userPo); | |||
//租户更新完毕 更新对应租户下的用户 | |||
List<UserPo> userPoList = clientUserMapper.selectByTenantId(userPo.getId()); | |||
for (UserPo po : userPoList) { | |||
po.setIsExpire(0); | |||
clientUserMapper.updatePass(userPo); | |||
} | |||
log.info("禁用对应租户及其用户状态完毕"); | |||
} | |||
} | |||
} | |||
} | |||
} |
@@ -75,4 +75,19 @@ tuoheng: | |||
# 高德Key | |||
gaodeKey: 5a1f63e7563cba471a9d0773e218144a | |||
# 图片域名 | |||
image-url: https://image.t-aaron.com/ | |||
image-url: https://image.t-aaron.com/ | |||
xxl: | |||
enable: true | |||
job: | |||
admin: | |||
addresses: http://192.168.11.11:8110/xxl-job-admin | |||
accessToken: tuoheng | |||
executor: | |||
appname: xxl-job-executor-oidc | |||
address: | |||
ip: | |||
# 多个后台,端口号不能相同 | |||
port: 9987 | |||
logpath: /data/java/logs/xxl-job/jobhandler | |||
logretentiondays: 15 |
@@ -74,4 +74,18 @@ tuoheng: | |||
# 高德Key | |||
gaodeKey: 5a1f63e7563cba471a9d0773e218144a | |||
# 图片域名 | |||
image-url: https://image.t-aaron.com/ | |||
image-url: https://image.t-aaron.com/ | |||
xxl: | |||
enable: true | |||
job: | |||
admin: | |||
addresses: https://xxl-job.t-aaron.com/xxl-job-admin/ | |||
accessToken: tuoheng | |||
executor: | |||
appname: xxl-job-executor-oidc | |||
address: | |||
ip: | |||
# 多个后台,端口号不能相同 | |||
port: 9987 | |||
logpath: /data/java/logs/xxl-job/jobhandler | |||
logretentiondays: 15 |
@@ -74,4 +74,18 @@ tuoheng: | |||
# 高德Key | |||
gaodeKey: 5a1f63e7563cba471a9d0773e218144a | |||
# 图片域名 | |||
image-url: https://image.t-aaron.com/ | |||
image-url: https://image.t-aaron.com/ | |||
xxl: | |||
enable: true | |||
job: | |||
admin: | |||
addresses: http://172.15.1.11:8110/xxl-job-admin | |||
accessToken: tuoheng | |||
executor: | |||
appname: xxl-job-executor-oidc | |||
address: | |||
ip: | |||
# 多个后台,端口号不能相同 | |||
port: 9987 | |||
logpath: /data/java/logs/xxl-job/jobhandler | |||
logretentiondays: 15 |
@@ -33,7 +33,9 @@ | |||
enabled, | |||
tenant_id, | |||
is_tenant, | |||
role_id | |||
role_id, | |||
is_expire, | |||
is_able | |||
FROM users | |||
WHERE id = #{userId} | |||
</select> | |||
@@ -85,6 +87,12 @@ | |||
<if test="enabled != null"> | |||
enabled = #{enabled}, | |||
</if> | |||
<if test="isAble != null"> | |||
is_able = #{isAble}, | |||
</if> | |||
<if test="isExpire != null"> | |||
is_expire = #{isExpire}, | |||
</if> | |||
</set> | |||
where username = #{username,jdbcType=VARCHAR} | |||
</update> |
@@ -5,7 +5,7 @@ | |||
id,create_time,update_time,create_user,update_user,user_id,remark,`code`,`name`, | |||
enabled,province_code,province_name, | |||
city_code,city_name,district_code,district_name,customer, | |||
customer_phone,adress,status,lng,lat | |||
customer_phone,adress,lng,lat | |||
</sql> | |||
<insert id="insertTenant" parameterType="com.tuoheng.model.po.TenantPo" keyProperty="id" useGeneratedKeys="true"> | |||
INSERT INTO t_tenant (user_id, remark, `code`, `name`, province_code, province_name, city_code, city_name, | |||
@@ -47,9 +47,9 @@ | |||
</select> | |||
<select id="findList" resultType="com.tuoheng.model.vo.TenantVo"> | |||
SELECT t.id, t.user_id userId, t.remark, t.code tenantCode, | |||
t.name tenantName,t.status,t.customer,t.customer_phone | |||
t.name tenantName,t.customer,t.customer_phone | |||
,t.province_code,t.province_name,t.city_code,t.city_name,t.district_code,t.district_name,u.username | |||
username,t.update_time updateTime,t.create_time createTime | |||
username,t.update_time updateTime,t.create_time createTime,u.is_able status | |||
FROM t_tenant t,users u | |||
WHERE t.enabled = 1 and t.user_id =u.id | |||
<if test="query.tenantName != null and query.tenantName != ''"> | |||
@@ -59,7 +59,7 @@ | |||
and u.username LIKE concat('%',#{query.username},'%') | |||
</if> | |||
<if test="query.status != null"> | |||
and t.status =#{query.status} | |||
and u.is_able =#{query.status} | |||
</if> | |||
ORDER BY t.create_time desc | |||
</select> |
@@ -75,4 +75,19 @@ tuoheng: | |||
# 高德Key | |||
gaodeKey: 5a1f63e7563cba471a9d0773e218144a | |||
# 图片域名 | |||
image-url: https://image.t-aaron.com/ | |||
image-url: https://image.t-aaron.com/ | |||
xxl: | |||
enable: true | |||
job: | |||
admin: | |||
addresses: http://192.168.11.11:8110/xxl-job-admin | |||
accessToken: tuoheng | |||
executor: | |||
appname: xxl-job-executor-odic | |||
address: | |||
ip: | |||
# 多个后台,端口号不能相同 | |||
port: 9987 | |||
logpath: /data/java/logs/xxl-job/jobhandler | |||
logretentiondays: 15 |
@@ -75,4 +75,19 @@ tuoheng: | |||
# 高德Key | |||
gaodeKey: 5a1f63e7563cba471a9d0773e218144a | |||
# 图片域名 | |||
image-url: https://image.t-aaron.com/ | |||
image-url: https://image.t-aaron.com/ | |||
xxl: | |||
enable: true | |||
job: | |||
admin: | |||
addresses: http://192.168.11.11:8110/xxl-job-admin | |||
accessToken: tuoheng | |||
executor: | |||
appname: xxl-job-executor-odic | |||
address: | |||
ip: | |||
# 多个后台,端口号不能相同 | |||
port: 9987 | |||
logpath: /data/java/logs/xxl-job/jobhandler | |||
logretentiondays: 15 |
@@ -74,4 +74,18 @@ tuoheng: | |||
# 高德Key | |||
gaodeKey: 5a1f63e7563cba471a9d0773e218144a | |||
# 图片域名 | |||
image-url: https://image.t-aaron.com/ | |||
image-url: https://image.t-aaron.com/ | |||
xxl: | |||
enable: true | |||
job: | |||
admin: | |||
addresses: https://xxl-job.t-aaron.com/xxl-job-admin/ | |||
accessToken: tuoheng | |||
executor: | |||
appname: xxl-job-executor-odic | |||
address: | |||
ip: | |||
# 多个后台,端口号不能相同 | |||
port: 9987 | |||
logpath: /data/java/logs/xxl-job/jobhandler | |||
logretentiondays: 15 |
@@ -74,4 +74,18 @@ tuoheng: | |||
# 高德Key | |||
gaodeKey: 5a1f63e7563cba471a9d0773e218144a | |||
# 图片域名 | |||
image-url: https://image.t-aaron.com/ | |||
image-url: https://image.t-aaron.com/ | |||
xxl: | |||
enable: true | |||
job: | |||
admin: | |||
addresses: http://172.15.1.11:8110/xxl-job-admin | |||
accessToken: tuoheng | |||
executor: | |||
appname: xxl-job-executor-odic | |||
address: | |||
ip: | |||
# 多个后台,端口号不能相同 | |||
port: 9987 | |||
logpath: /data/java/logs/xxl-job/jobhandler | |||
logretentiondays: 15 |
@@ -85,6 +85,12 @@ | |||
<if test="enabled != null"> | |||
enabled = #{enabled}, | |||
</if> | |||
<if test="isAble != null"> | |||
is_able = #{isAble}, | |||
</if> | |||
<if test="isExpire != null"> | |||
is_expire = #{isExpire}, | |||
</if> | |||
</set> | |||
where username = #{username,jdbcType=VARCHAR} | |||
</update> |
@@ -5,7 +5,7 @@ | |||
id,create_time,update_time,create_user,update_user,user_id,remark,`code`,`name`, | |||
enabled,province_code,province_name, | |||
city_code,city_name,district_code,district_name,customer, | |||
customer_phone,adress,status,lng,lat | |||
customer_phone,adress,lng,lat | |||
</sql> | |||
<insert id="insertTenant" parameterType="com.tuoheng.model.po.TenantPo" keyProperty="id" useGeneratedKeys="true"> | |||
INSERT INTO t_tenant (user_id, remark, `code`, `name`, province_code, province_name, city_code, city_name, | |||
@@ -47,9 +47,9 @@ | |||
</select> | |||
<select id="findList" resultType="com.tuoheng.model.vo.TenantVo"> | |||
SELECT t.id, t.user_id userId, t.remark, t.code tenantCode, | |||
t.name tenantName,t.status,t.customer,t.customer_phone | |||
t.name tenantName,t.customer,t.customer_phone | |||
,t.province_code,t.province_name,t.city_code,t.city_name,t.district_code,t.district_name,u.username | |||
username,t.update_time updateTime,t.create_time createTime | |||
username,t.update_time updateTime,t.create_time createTime,u.is_able status | |||
FROM t_tenant t,users u | |||
WHERE t.enabled = 1 and t.user_id =u.id | |||
<if test="query.tenantName != null and query.tenantName != ''"> | |||
@@ -59,7 +59,7 @@ | |||
and u.username LIKE concat('%',#{query.username},'%') | |||
</if> | |||
<if test="query.status != null"> | |||
and t.status =#{query.status} | |||
and u.is_able =#{query.status} | |||
</if> | |||
ORDER BY t.create_time desc | |||
</select> |
@@ -0,0 +1,181 @@ | |||
com\tuoheng\service\impl\AreaServiceImpl.class | |||
com\tuoheng\mapper\AreaMapper.class | |||
com\tuoheng\service\op\Impl\RolesServiceImpl.class | |||
com\tuoheng\service\op\RolesService.class | |||
com\tuoheng\third\service\impl\ThirdServiceImpl$3.class | |||
com\tuoheng\model\dto\LoginUser.class | |||
com\tuoheng\controller\PlatformController.class | |||
com\tuoheng\constant\CommonConstant.class | |||
com\tuoheng\mapper\ClientMapper.class | |||
com\tuoheng\service\TenantService.class | |||
com\tuoheng\model\param\UpdateUserPassDto.class | |||
com\tuoheng\model\po\ClientUserRolePo.class | |||
com\tuoheng\model\vo\MenuindexVo.class | |||
com\tuoheng\until\RedisUtils.class | |||
com\tuoheng\model\vo\UserVo.class | |||
com\tuoheng\model\vo\RoleListVo.class | |||
com\tuoheng\model\query\TenantQuery.class | |||
com\tuoheng\service\op\RoleMenuService.class | |||
com\tuoheng\controller\information\InformationController.class | |||
com\tuoheng\service\op\MenusService.class | |||
com\tuoheng\mapper\information\InspectionFileMapper.class | |||
com\tuoheng\common\ExceptionInterface.class | |||
com\tuoheng\third\vo\RoleMenuVo.class | |||
com\tuoheng\third\request\ThirdRequest.class | |||
com\tuoheng\model\param\CreateClientUserDto.class | |||
com\tuoheng\third\service\ThirdService.class | |||
com\tuoheng\service\information\ReportService.class | |||
com\tuoheng\mapper\information\ReportMapper.class | |||
com\tuoheng\service\impl\TenantServiceImpl.class | |||
com\tuoheng\model\dto\TTenant.class | |||
com\tuoheng\model\query\InformationQuery.class | |||
com\tuoheng\service\information\WorkorderService.class | |||
com\tuoheng\service\impl\TenantItemServiceImpl.class | |||
com\tuoheng\third\vo\IndustryVo.class | |||
com\tuoheng\model\po\TenantPo.class | |||
com\tuoheng\common\BaseQuery.class | |||
com\tuoheng\mapper\DictMapper.class | |||
com\tuoheng\model\dto\ClientRoleListDto.class | |||
com\tuoheng\model\entity\RoleMenu.class | |||
com\tuoheng\model\param\GetUserInfoDto.class | |||
com\tuoheng\service\impl\TenantEmployServiceImpl.class | |||
com\tuoheng\model\dto\Platform.class | |||
com\tuoheng\mapper\op\PermissionsMapper.class | |||
com\tuoheng\model\entity\Dict.class | |||
com\tuoheng\model\dto\City.class | |||
com\tuoheng\model\query\CityQuery.class | |||
com\tuoheng\mapper\op\MenusMapper.class | |||
com\tuoheng\mapper\DictDataMapper.class | |||
com\tuoheng\model\entity\Workorder.class | |||
com\tuoheng\until\JsonResult.class | |||
com\tuoheng\third\service\impl\ThirdServiceImpl$2.class | |||
com\tuoheng\common\ServiceException.class | |||
com\tuoheng\mapper\op\RolesMapper.class | |||
com\tuoheng\model\entity\TenantEmploy.class | |||
com\tuoheng\third\controller\ThirdController.class | |||
com\tuoheng\service\op\Impl\MenusServiceImpl.class | |||
com\tuoheng\service\impl\MarkerServiceImpl.class | |||
com\tuoheng\service\MarkerService.class | |||
com\tuoheng\service\DictDataService.class | |||
com\tuoheng\model\query\UserQuery.class | |||
com\tuoheng\model\vo\RolePermissionVo.class | |||
com\tuoheng\model\vo\MarkerVo.class | |||
com\tuoheng\model\po\UserPo.class | |||
com\tuoheng\service\TenantItemService.class | |||
com\tuoheng\model\dto\RoleMenuDto.class | |||
com\tuoheng\model\entity\Menu.class | |||
com\tuoheng\model\vo\MenuVo.class | |||
com\tuoheng\service\information\InspectionService.class | |||
com\tuoheng\mapper\op\RolePermissionMapper.class | |||
com\tuoheng\model\query\RoleClientQuery.class | |||
com\tuoheng\model\entity\Area.class | |||
com\tuoheng\config\OptimizationObjectMapper.class | |||
com\tuoheng\model\entity\Inspection.class | |||
com\tuoheng\model\query\AreaQuery.class | |||
com\tuoheng\mapper\MarkerMapper.class | |||
com\tuoheng\service\op\Impl\PermissionsServiceImpl.class | |||
com\tuoheng\model\entity\InspectionFile.class | |||
com\tuoheng\common\CommonConfig.class | |||
com\tuoheng\service\AreaService.class | |||
com\tuoheng\common\ExceptionCatch.class | |||
com\tuoheng\service\op\Impl\RoleMenuServiceImpl.class | |||
com\tuoheng\mapper\ClientUserRoleMapper.class | |||
com\tuoheng\controller\AreaController.class | |||
com\tuoheng\mapper\TenantMapper.class | |||
com\tuoheng\mapper\TenantItemMapper.class | |||
com\tuoheng\service\impl\PlatformServiceImpl.class | |||
com\tuoheng\mapper\TenantEmployMapper.class | |||
com\tuoheng\service\information\InspectionFileService.class | |||
com\tuoheng\third\vo\RoleMenuListVo.class | |||
com\tuoheng\service\op\Impl\RolePermissionServiceImpl.class | |||
com\tuoheng\service\information\impl\WorkorderServiceImpl.class | |||
com\tuoheng\TuohengOidcAdminApplication.class | |||
com\tuoheng\mapper\CityMapper.class | |||
com\tuoheng\config\http\RestProperties.class | |||
com\tuoheng\model\entity\Report.class | |||
com\tuoheng\controller\ClientController.class | |||
com\tuoheng\model\entity\RolePermission.class | |||
com\tuoheng\mapper\information\InspectionMapper.class | |||
com\tuoheng\mapper\PlatformMapper.class | |||
com\tuoheng\service\op\RolePermissionService.class | |||
com\tuoheng\service\CityService.class | |||
com\tuoheng\model\entity\Permissions.class | |||
com\tuoheng\controller\DemoController.class | |||
com\tuoheng\service\TenantEmployService.class | |||
com\tuoheng\config\MybatisPlusConfig.class | |||
com\tuoheng\model\query\ReportQuery.class | |||
com\tuoheng\constant\DspConstant.class | |||
com\tuoheng\model\query\MenuQuery.class | |||
com\tuoheng\model\request\AirportRequest.class | |||
com\tuoheng\enums\MarkTypeEnum.class | |||
com\tuoheng\config\http\RestTemplateConfig.class | |||
com\tuoheng\third\vo\ServiceExampleVo.class | |||
com\tuoheng\until\MapUtils.class | |||
com\tuoheng\model\entity\DictData.class | |||
com\tuoheng\model\query\MarkerQuery.class | |||
com\tuoheng\third\service\impl\ThirdServiceImpl$1.class | |||
com\tuoheng\service\impl\ClientServiceImpl.class | |||
com\tuoheng\model\entity\TenantItem.class | |||
com\tuoheng\service\impl\DictDataServiceImpl.class | |||
com\tuoheng\third\vo\MenuVo.class | |||
com\tuoheng\controller\CityController.class | |||
com\tuoheng\model\dto\UserBaseInfoDto.class | |||
com\tuoheng\service\information\impl\InspectionServiceImpl.class | |||
com\tuoheng\service\impl\DictServiceImpl.class | |||
com\tuoheng\controller\DictController.class | |||
com\tuoheng\mapper\op\RoleMenuMapper.class | |||
com\tuoheng\model\po\BasePo.class | |||
com\tuoheng\mapper\ClientUserMapper.class | |||
com\tuoheng\controller\information\ReportController.class | |||
com\tuoheng\config\http\HeadClientHttpRequestInterceptor.class | |||
com\tuoheng\service\op\PermissionsService.class | |||
com\tuoheng\model\vo\CreateTenantVo.class | |||
com\tuoheng\controller\information\InformationFileController.class | |||
com\tuoheng\model\dto\ClientDto.class | |||
com\tuoheng\service\PlatformService.class | |||
com\tuoheng\controller\op\MenuController.class | |||
com\tuoheng\service\impl\Oauth2RegisteredClientServiceImpl.class | |||
com\tuoheng\until\EncryptUtil.class | |||
com\tuoheng\model\dto\OidcTenantDto.class | |||
com\tuoheng\mapper\information\WorkorderMapper.class | |||
com\tuoheng\model\param\ClientRoleDto.class | |||
com\tuoheng\model\param\CreateClientTenantDto.class | |||
com\tuoheng\model\dto\ClientRoleInfoDto.class | |||
com\tuoheng\service\information\impl\ReportServiceImpl.class | |||
com\tuoheng\config\WebConfig.class | |||
com\tuoheng\model\query\WorkorderQuery.class | |||
com\tuoheng\service\impl\ClientUserServiceImpl.class | |||
com\tuoheng\service\CurrentUser.class | |||
com\tuoheng\controller\UserController.class | |||
com\tuoheng\service\ClientSevice.class | |||
com\tuoheng\service\Oauth2RegisteredClientService.class | |||
com\tuoheng\controller\op\PermissionController.class | |||
com\tuoheng\constant\DictConstant.class | |||
com\tuoheng\mapper\Oauth2RegisteredClientMapper.class | |||
com\tuoheng\until\CryptoUtil.class | |||
com\tuoheng\model\query\RoleQuery.class | |||
com\tuoheng\model\param\GetClientTenantRoleDto.class | |||
com\tuoheng\model\vo\BusinessSystemVo.class | |||
com\tuoheng\common\ServiceExceptionEnum.class | |||
com\tuoheng\service\information\impl\InspectionFileServiceImpl.class | |||
com\tuoheng\model\vo\OpPermissionsVo.class | |||
com\tuoheng\service\DictService.class | |||
com\tuoheng\service\impl\CityServiceImpl.class | |||
com\tuoheng\service\ClientUserSevice.class | |||
com\tuoheng\config\http\RestTemplateConfig$1.class | |||
com\tuoheng\model\param\UpdateUserClientRoleDto.class | |||
com\tuoheng\model\dto\RoleDto.class | |||
com\tuoheng\controller\MarkerController.class | |||
com\tuoheng\controller\TenantController.class | |||
com\tuoheng\mapper\AuthoritiesMapper.class | |||
com\tuoheng\model\dto\RoleMenuPermissionDto.class | |||
com\tuoheng\model\entity\Roles.class | |||
com\tuoheng\model\po\AuthoritiesPo.class | |||
com\tuoheng\controller\information\WorkorderController.class | |||
com\tuoheng\model\vo\TenantVo.class | |||
com\tuoheng\model\entity\Marker.class | |||
com\tuoheng\controller\op\RoleController.class | |||
com\tuoheng\config\LoginUserHandler.class | |||
com\tuoheng\third\service\impl\ThirdServiceImpl.class | |||
com\tuoheng\model\dto\Oauth2RegisteredClient.class | |||
com\tuoheng\model\query\InspectionFileQuery.class |
@@ -10,18 +10,21 @@ D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_admin\src\main\java\com\tuoheng\m | |||
D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_admin\src\main\java\com\tuoheng\third\vo\RoleMenuVo.java | |||
D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_admin\src\main\java\com\tuoheng\service\op\Impl\MenusServiceImpl.java | |||
D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_admin\src\main\java\com\tuoheng\model\dto\RoleMenuDto.java | |||
D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_admin\src\main\java\com\tuoheng\model\entity\Dict.java | |||
D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_admin\src\main\java\com\tuoheng\service\impl\ClientUserServiceImpl.java | |||
D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_admin\src\main\java\com\tuoheng\mapper\ClientUserRoleMapper.java | |||
D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_admin\src\main\java\com\tuoheng\service\impl\Oauth2RegisteredClientServiceImpl.java | |||
D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_admin\src\main\java\com\tuoheng\model\dto\ClientDto.java | |||
D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_admin\src\main\java\com\tuoheng\service\op\RolesService.java | |||
D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_admin\src\main\java\com\tuoheng\common\ServiceExceptionEnum.java | |||
D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_admin\src\main\java\com\tuoheng\mapper\DictDataMapper.java | |||
D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_admin\src\main\java\com\tuoheng\model\query\RoleQuery.java | |||
D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_admin\src\main\java\com\tuoheng\model\entity\Area.java | |||
D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_admin\src\main\java\com\tuoheng\model\entity\Marker.java | |||
D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_admin\src\main\java\com\tuoheng\service\information\WorkorderService.java | |||
D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_admin\src\main\java\com\tuoheng\service\op\Impl\PermissionsServiceImpl.java | |||
D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_admin\src\main\java\com\tuoheng\service\TenantItemService.java | |||
D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_admin\src\main\java\com\tuoheng\model\entity\DictData.java | |||
D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_admin\src\main\java\com\tuoheng\third\vo\MenuVo.java | |||
D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_admin\src\main\java\com\tuoheng\common\BaseQuery.java | |||
D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_admin\src\main\java\com\tuoheng\model\vo\MarkerVo.java | |||
@@ -32,6 +35,7 @@ D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_admin\src\main\java\com\tuoheng\s | |||
D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_admin\src\main\java\com\tuoheng\model\po\AuthoritiesPo.java | |||
D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_admin\src\main\java\com\tuoheng\TuohengOidcAdminApplication.java | |||
D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_admin\src\main\java\com\tuoheng\common\CommonConfig.java | |||
D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_admin\src\main\java\com\tuoheng\service\impl\DictDataServiceImpl.java | |||
D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_admin\src\main\java\com\tuoheng\until\EncryptUtil.java | |||
D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_admin\src\main\java\com\tuoheng\model\po\UserPo.java | |||
D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_admin\src\main\java\com\tuoheng\model\query\AreaQuery.java | |||
@@ -96,6 +100,7 @@ D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_admin\src\main\java\com\tuoheng\c | |||
D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_admin\src\main\java\com\tuoheng\mapper\PlatformMapper.java | |||
D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_admin\src\main\java\com\tuoheng\model\vo\UserVo.java | |||
D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_admin\src\main\java\com\tuoheng\model\param\UpdateUserPassDto.java | |||
D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_admin\src\main\java\com\tuoheng\service\impl\DictServiceImpl.java | |||
D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_admin\src\main\java\com\tuoheng\service\information\impl\WorkorderServiceImpl.java | |||
D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_admin\src\main\java\com\tuoheng\controller\UserController.java | |||
D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_admin\src\main\java\com\tuoheng\model\dto\ClientRoleInfoDto.java | |||
@@ -114,32 +119,31 @@ D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_admin\src\main\java\com\tuoheng\m | |||
D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_admin\src\main\java\com\tuoheng\mapper\Oauth2RegisteredClientMapper.java | |||
D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_admin\src\main\java\com\tuoheng\model\vo\TenantVo.java | |||
D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_admin\src\main\java\com\tuoheng\model\dto\City.java | |||
D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_admin\src\main\java\com\tuoheng\service\DictDataService.java | |||
D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_admin\src\main\java\com\tuoheng\model\param\ClientRoleDto.java | |||
D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_admin\src\main\java\com\tuoheng\controller\DictController.java | |||
D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_admin\src\main\java\com\tuoheng\mapper\op\RolePermissionMapper.java | |||
D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_admin\src\main\java\com\tuoheng\model\po\TenantPo.java | |||
D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_admin\src\main\java\com\tuoheng\service\ClientSevice.java | |||
D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_admin\src\main\java\com\tuoheng\model\po\ClientUserRolePo.java | |||
D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_admin\src\main\java\com\tuoheng\service\impl\MarkerServiceImpl.java | |||
D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_admin\src\main\java\com\tuoheng\constant\PilotConstant.java | |||
D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_admin\src\main\java\com\tuoheng\controller\PlatformController.java | |||
D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_admin\src\main\java\com\tuoheng\service\AreaService.java | |||
D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_admin\src\main\java\com\tuoheng\controller\TenantController.java | |||
D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_admin\src\main\java\com\tuoheng\service\CityService.java | |||
D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_admin\src\main\java\com\tuoheng\constant\AirportConstant.java | |||
D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_admin\src\main\java\com\tuoheng\model\query\CityQuery.java | |||
D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_admin\src\main\java\com\tuoheng\third\request\ThirdRequest.java | |||
D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_admin\src\main\java\com\tuoheng\common\ExceptionInterface.java | |||
D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_admin\src\main\java\com\tuoheng\constant\FreeWayConstant.java | |||
D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_admin\src\main\java\com\tuoheng\service\DictService.java | |||
D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_admin\src\main\java\com\tuoheng\mapper\op\RolesMapper.java | |||
D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_admin\src\main\java\com\tuoheng\controller\op\PermissionController.java | |||
D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_admin\src\main\java\com\tuoheng\service\op\MenusService.java | |||
D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_admin\src\main\java\com\tuoheng\model\request\AirportRequest.java | |||
D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_admin\src\main\java\com\tuoheng\constant\WaterWayConstant.java | |||
D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_admin\src\main\java\com\tuoheng\constant\DictConstant.java | |||
D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_admin\src\main\java\com\tuoheng\config\http\RestProperties.java | |||
D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_admin\src\main\java\com\tuoheng\enums\MarkTypeEnum.java | |||
D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_admin\src\main\java\com\tuoheng\third\vo\ServiceExampleVo.java | |||
D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_admin\src\main\java\com\tuoheng\config\http\HeadClientHttpRequestInterceptor.java | |||
D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_admin\src\main\java\com\tuoheng\constant\HhzUrlConstant.java | |||
D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_admin\src\main\java\com\tuoheng\controller\information\ReportController.java | |||
D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_admin\src\main\java\com\tuoheng\model\param\CreateClientTenantDto.java | |||
D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_admin\src\main\java\com\tuoheng\service\op\Impl\RoleMenuServiceImpl.java | |||
@@ -158,6 +162,7 @@ D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_admin\src\main\java\com\tuoheng\s | |||
D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_admin\src\main\java\com\tuoheng\service\impl\PlatformServiceImpl.java | |||
D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_admin\src\main\java\com\tuoheng\service\information\InspectionService.java | |||
D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_admin\src\main\java\com\tuoheng\mapper\MarkerMapper.java | |||
D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_admin\src\main\java\com\tuoheng\mapper\DictMapper.java | |||
D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_admin\src\main\java\com\tuoheng\model\dto\RoleDto.java | |||
D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_admin\src\main\java\com\tuoheng\mapper\op\MenusMapper.java | |||
D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_admin\src\main\java\com\tuoheng\service\ClientUserSevice.java |
@@ -0,0 +1 @@ | |||
com\tuoheng\passwordTest.class |
@@ -47,6 +47,10 @@ public class IdTokenCustomizerConfig { | |||
.collect(Collectors.toSet()))) | |||
.claims(claims -> | |||
claims.put("username", context.getPrincipal().getName())) | |||
.claims(claims -> | |||
claims.put("isAble", userBaseInfoDto.getIsAble())) | |||
.claims(claims -> | |||
claims.put("isExpire", userBaseInfoDto.getIsExpire())) | |||
.claims(claims -> | |||
claims.put("oUserId", userBaseInfoDto.getUserId())) | |||
.claims(claims -> |
@@ -1,5 +1,6 @@ | |||
package com.tuoheng.config; | |||
import com.tuoheng.exception.DiyException; | |||
import com.tuoheng.oauth2.authentication.OAuth2ResourceOwnerPasswordAuthenticationConverter; | |||
import com.tuoheng.handler.AccessDeniedHandler; | |||
import com.tuoheng.mapper.UserMapper; | |||
@@ -21,6 +22,7 @@ import org.springframework.security.config.annotation.web.configurers.Expression | |||
import org.springframework.security.config.annotation.web.configurers.oauth2.server.authorization.OAuth2AuthorizationServerConfigurer; | |||
import org.springframework.security.config.annotation.web.configurers.oauth2.server.resource.OAuth2ResourceServerConfigurer; | |||
import org.springframework.security.core.userdetails.UserDetailsService; | |||
import org.springframework.security.oauth2.core.OAuth2AuthenticationException; | |||
import org.springframework.security.oauth2.core.OAuth2Token; | |||
import org.springframework.security.oauth2.core.oidc.OidcUserInfo; | |||
import org.springframework.security.oauth2.server.authorization.OAuth2AuthorizationService; | |||
@@ -94,14 +96,14 @@ public class SecurityConfig { | |||
.authorizeRequests((authorizeRequests) -> { | |||
((ExpressionUrlAuthorizationConfigurer.AuthorizedUrl) authorizeRequests.anyRequest()).authenticated(); | |||
}).csrf((csrf) -> { | |||
csrf.ignoringRequestMatchers(new RequestMatcher[]{endpointsMatcher}); | |||
}).apply(authorizationServerConfigurer) | |||
csrf.ignoringRequestMatchers(new RequestMatcher[]{endpointsMatcher}); | |||
}).apply(authorizationServerConfigurer) | |||
.and() | |||
.oauth2ResourceServer(OAuth2ResourceServerConfigurer::jwt) | |||
.exceptionHandling(exceptions -> exceptions | |||
.authenticationEntryPoint(new LoginUrlAuthenticationEntryPoint("/toLogin")) | |||
.accessDeniedHandler(new AccessDeniedHandler())) | |||
//.authenticationEntryPoint(new AuthenticationEntryPoint())) | |||
//.authenticationEntryPoint(new AuthenticationEntryPoint())) | |||
.apply(authorizationServerConfigurer); | |||
SecurityFilterChain securityFilterChain = http.build(); | |||
addCustomOAuth2ResourceOwnerPasswordAuthenticationProvider(http); | |||
@@ -112,11 +114,11 @@ public class SecurityConfig { | |||
@Order(2) | |||
SecurityFilterChain defaultSecurityFilterChain(HttpSecurity http) throws Exception { | |||
//http.addFilterBefore(verifyCodeFilter, UsernamePasswordAuthenticationFilter.class); | |||
http.addFilterAt(new VerifyCodeFilter(),UsernamePasswordAuthenticationFilter.class); | |||
http.addFilterAt(new VerifyCodeFilter(), UsernamePasswordAuthenticationFilter.class); | |||
http.csrf().disable() | |||
.authorizeHttpRequests((authorize) -> authorize | |||
.antMatchers("/toLogin", "/getHealth", "/static/**", "/vercode").permitAll() | |||
.antMatchers("/user/create","/user/getInfo").permitAll() | |||
.antMatchers("/user/create", "/user/getInfo").permitAll() | |||
.anyRequest().authenticated() | |||
) | |||
// Form login handles the redirect to the login page from the |
@@ -0,0 +1,52 @@ | |||
package com.tuoheng.exception; | |||
public class DiyException extends RuntimeException { | |||
private static final long serialVersionUID = -783442404816393286L; | |||
//默认错误异常码为-1 | |||
public static final int ERROR_CODE_DEFAULT = -1; | |||
private String msg; | |||
private int code; | |||
public String getMsg() { | |||
return msg; | |||
} | |||
public void setMsg(String msg) { | |||
this.msg = msg; | |||
} | |||
public int getCode() { | |||
return code; | |||
} | |||
public void setCode(int code) { | |||
this.code = code; | |||
} | |||
/** | |||
* 带参构造器 | |||
* | |||
* @param msg 异常信息 | |||
*/ | |||
public DiyException(String msg) { | |||
super(msg); | |||
this.code = ERROR_CODE_DEFAULT; | |||
this.msg = msg; | |||
} | |||
/** | |||
* 带参构造器 | |||
* | |||
* @param code 异常码 | |||
* @param msg 异常信息 | |||
*/ | |||
public DiyException(int code, String msg) { | |||
super(msg); | |||
this.code = code; | |||
this.msg = msg; | |||
} | |||
} | |||
@@ -13,5 +13,4 @@ public class ClientRoleDto { | |||
private String clientId; | |||
private Integer roleId; | |||
} |
@@ -28,4 +28,8 @@ public class UserBaseInfoDto { | |||
*/ | |||
private List<ClientRoleDto> clientRoleDtoList; | |||
private Integer isAble; | |||
private Integer isExpire; | |||
} |
@@ -1,19 +1,12 @@ | |||
package com.tuoheng.service.impl; | |||
import com.nimbusds.jose.shaded.json.JSONObject; | |||
import com.tuoheng.mapper.UserMapper; | |||
import com.tuoheng.model.dto.UserBaseInfoDto; | |||
import com.tuoheng.service.OidcUserInfoService; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.security.oauth2.core.oidc.OidcScopes; | |||
import org.springframework.security.oauth2.core.oidc.OidcUserInfo; | |||
import org.springframework.stereotype.Service; | |||
import org.springframework.util.CollectionUtils; | |||
import java.time.LocalDateTime; | |||
import java.time.format.DateTimeFormatter; | |||
import java.util.Calendar; | |||
import java.util.Collections; | |||
import java.util.Set; | |||
/** | |||
@@ -31,6 +24,8 @@ public class OidcUserInfoServiceImpl implements OidcUserInfoService { | |||
if (scopes.contains(OidcScopes.PROFILE)) { | |||
builder.claim("userId", userBaseInfoDto.getUserId()) | |||
.claim("userName", userBaseInfoDto.getUserName()) | |||
.claim("isExpire", userBaseInfoDto.getIsExpire()) | |||
.claim("isAble", userBaseInfoDto.getIsAble()) | |||
.claim("authority", userBaseInfoDto.getAuthorityList()) | |||
.claim("clientRoleList", userBaseInfoDto.getClientRoleDtoList()); | |||
} |
@@ -3,15 +3,17 @@ | |||
<mapper namespace="com.tuoheng.mapper.UserMapper"> | |||
<resultMap type="com.tuoheng.model.dto.UserBaseInfoDto" id="UserBaseInfoMap"> | |||
<id column="userId" jdbcType="INTEGER" property="userId" /> | |||
<result column="userName" jdbcType="VARCHAR" property="userName" /> | |||
<result column="password" jdbcType="VARCHAR" property="password" /> | |||
<id column="userId" jdbcType="INTEGER" property="userId"/> | |||
<result column="userName" jdbcType="VARCHAR" property="userName"/> | |||
<result column="password" jdbcType="VARCHAR" property="password"/> | |||
<result column="isAble" jdbcType="INTEGER" property="isAble"/> | |||
<result column="isExpire" jdbcType="INTEGER" property="isExpire"/> | |||
<collection property="authorityList" ofType="java.lang.String" javaType="java.util.List"> | |||
<result column="authority" jdbcType="VARCHAR"/> | |||
</collection> | |||
<collection property="clientRoleDtoList" ofType="com.tuoheng.model.dto.ClientRoleDto" javaType="java.util.List"> | |||
<result column="clientId" jdbcType="VARCHAR" property="clientId" /> | |||
<result column="roleId" jdbcType="INTEGER" property="roleId" /> | |||
<result column="clientId" jdbcType="VARCHAR" property="clientId"/> | |||
<result column="roleId" jdbcType="INTEGER" property="roleId"/> | |||
</collection> | |||
</resultMap> | |||
@@ -21,7 +23,14 @@ | |||
</insert> | |||
<select id="getUserBaseInfo" resultMap="UserBaseInfoMap"> | |||
select a.id as userId, a.username as userName, a.password , b.authority, c.client_id as clientId, c.role_id as roleId | |||
select a.id as userId, | |||
a.username as userName, | |||
a.password, | |||
b.authority, | |||
c.client_id as clientId, | |||
c.role_id as roleId, | |||
a.is_able as isAble, | |||
a.is_expire as isExpire | |||
from users a | |||
left join authorities b on a.id = b.user_id | |||
left join t_client_user_role c on a.id = c.user_id | |||
@@ -29,7 +38,14 @@ | |||
</select> | |||
<select id="getMpUserInfo" resultMap="UserBaseInfoMap"> | |||
select a.id as userId, a.username as userName, a.password , b.authority, c.client_id as clientId, c.role_id as roleId | |||
select a.id as userId, | |||
a.username as userName, | |||
a.password, | |||
b.authority, | |||
c.client_id as clientId, | |||
c.role_id as roleId, | |||
a.is_able as isAble, | |||
a.is_expire as isExpire | |||
from users a | |||
left join authorities b on a.id = b.user_id | |||
left join t_client_user_role c on a.id = c.user_id |
@@ -54,6 +54,7 @@ | |||
display: flex; | |||
flex-direction: column; | |||
background: transparent; | |||
position: relative; | |||
} | |||
form input{ | |||
height: 40px; | |||
@@ -101,16 +102,32 @@ | |||
.form__tips.is--error{ | |||
color: red | |||
} | |||
/* 密码框显示隐藏图表 */ | |||
#close_eyes, #open_eyes{ | |||
width: 18px; | |||
height: 18px; | |||
position: absolute; | |||
right: 50px; | |||
top: 72px; | |||
} | |||
#open_eyes { | |||
display: none; | |||
} | |||
</style> | |||
</head> | |||
<body> | |||
<div class="login__back"> | |||
<div class="login__form"> | |||
<h2>拓恒统一登录平台</h2> | |||
<p>TUOHENG LOGIN PLATFORM</p> | |||
<h2>统一登录平台</h2> | |||
<p>LOGIN PLATFORM</p> | |||
<form th:action="@{/login}" method="post"> | |||
<input name="username" placeholder="请输入用户名" type="text"/> | |||
<input name="password" placeholder="请输入密码" type="password"/> | |||
<input id="password" name="password" placeholder="请输入密码" type="password"/> | |||
<!-- 密码显示隐藏 --> | |||
<img src="../static/close.png" alt="" id="close_eyes"> | |||
<img src="../static/open.png" alt="" id="open_eyes"> | |||
<div class="form__code"> | |||
<input name="validateCode" placeholder="请输入验证码" /> | |||
<input id="codekey" name="codekey" type="hidden"/> | |||
@@ -150,6 +167,21 @@ | |||
}) | |||
} | |||
// 密码显示隐藏 | |||
const passwordDom = document.getElementById('password') | |||
const openIcon = document.getElementById('open_eyes') | |||
const closeIcon = document.getElementById('close_eyes') | |||
closeIcon.onclick = function() { | |||
passwordDom.type = 'text' | |||
openIcon.style.display = 'block' | |||
closeIcon.style.display = 'none' | |||
} | |||
openIcon.onclick = function() { | |||
passwordDom.type = 'password' | |||
openIcon.style.display = 'none' | |||
closeIcon.style.display = 'block' | |||
} | |||
$(document).ready(function() { | |||
$.ajax({ | |||
url : "/vercode",//后台请求的数据 |
@@ -3,15 +3,16 @@ | |||
<mapper namespace="com.tuoheng.mapper.UserMapper"> | |||
<resultMap type="com.tuoheng.model.dto.UserBaseInfoDto" id="UserBaseInfoMap"> | |||
<id column="userId" jdbcType="INTEGER" property="userId" /> | |||
<result column="userName" jdbcType="VARCHAR" property="userName" /> | |||
<result column="password" jdbcType="VARCHAR" property="password" /> | |||
<collection property="authorityList" ofType="java.lang.String" javaType="java.util.List"> | |||
<id column="userId" jdbcType="INTEGER" property="userId"/> | |||
<result column="userName" jdbcType="VARCHAR" property="userName"/> | |||
<result column="password" jdbcType="VARCHAR" property="password"/> | |||
<collection property="authorityList" ofType="com.tuoheng.model.dto.AuthoritiesDto" javaType="java.util.List"> | |||
<result column="authority" jdbcType="VARCHAR"/> | |||
<result column="status" jdbcType="INTEGER"/> | |||
</collection> | |||
<collection property="clientRoleDtoList" ofType="com.tuoheng.model.dto.ClientRoleDto" javaType="java.util.List"> | |||
<result column="clientId" jdbcType="VARCHAR" property="clientId" /> | |||
<result column="roleId" jdbcType="INTEGER" property="roleId" /> | |||
<result column="clientId" jdbcType="VARCHAR" property="clientId"/> | |||
<result column="roleId" jdbcType="INTEGER" property="roleId"/> | |||
</collection> | |||
</resultMap> | |||
@@ -21,7 +22,12 @@ | |||
</insert> | |||
<select id="getUserBaseInfo" resultMap="UserBaseInfoMap"> | |||
select a.id as userId, a.username as userName, a.password , b.authority, c.client_id as clientId, c.role_id as roleId | |||
select a.id as userId, | |||
a.username as userName, | |||
a.password, | |||
b.authority, | |||
c.client_id as clientId, | |||
c.role_id as roleId | |||
from users a | |||
left join authorities b on a.id = b.user_id | |||
left join t_client_user_role c on a.id = c.user_id | |||
@@ -29,7 +35,12 @@ | |||
</select> | |||
<select id="getMpUserInfo" resultMap="UserBaseInfoMap"> | |||
select a.id as userId, a.username as userName, a.password , b.authority, c.client_id as clientId, c.role_id as roleId | |||
select a.id as userId, | |||
a.username as userName, | |||
a.password, | |||
b.authority, | |||
c.client_id as clientId, | |||
c.role_id as roleId | |||
from users a | |||
left join authorities b on a.id = b.user_id | |||
left join t_client_user_role c on a.id = c.user_id |
@@ -3,15 +3,17 @@ | |||
<mapper namespace="com.tuoheng.mapper.UserMapper"> | |||
<resultMap type="com.tuoheng.model.dto.UserBaseInfoDto" id="UserBaseInfoMap"> | |||
<id column="userId" jdbcType="INTEGER" property="userId" /> | |||
<result column="userName" jdbcType="VARCHAR" property="userName" /> | |||
<result column="password" jdbcType="VARCHAR" property="password" /> | |||
<id column="userId" jdbcType="INTEGER" property="userId"/> | |||
<result column="userName" jdbcType="VARCHAR" property="userName"/> | |||
<result column="password" jdbcType="VARCHAR" property="password"/> | |||
<result column="isAble" jdbcType="INTEGER" property="isAble"/> | |||
<result column="isExpire" jdbcType="INTEGER" property="isExpire"/> | |||
<collection property="authorityList" ofType="java.lang.String" javaType="java.util.List"> | |||
<result column="authority" jdbcType="VARCHAR"/> | |||
</collection> | |||
<collection property="clientRoleDtoList" ofType="com.tuoheng.model.dto.ClientRoleDto" javaType="java.util.List"> | |||
<result column="clientId" jdbcType="VARCHAR" property="clientId" /> | |||
<result column="roleId" jdbcType="INTEGER" property="roleId" /> | |||
<result column="clientId" jdbcType="VARCHAR" property="clientId"/> | |||
<result column="roleId" jdbcType="INTEGER" property="roleId"/> | |||
</collection> | |||
</resultMap> | |||
@@ -21,7 +23,14 @@ | |||
</insert> | |||
<select id="getUserBaseInfo" resultMap="UserBaseInfoMap"> | |||
select a.id as userId, a.username as userName, a.password , b.authority, c.client_id as clientId, c.role_id as roleId | |||
select a.id as userId, | |||
a.username as userName, | |||
a.password, | |||
b.authority, | |||
c.client_id as clientId, | |||
c.role_id as roleId, | |||
a.is_able as isAble, | |||
a.is_expire as isExpire | |||
from users a | |||
left join authorities b on a.id = b.user_id | |||
left join t_client_user_role c on a.id = c.user_id | |||
@@ -29,7 +38,14 @@ | |||
</select> | |||
<select id="getMpUserInfo" resultMap="UserBaseInfoMap"> | |||
select a.id as userId, a.username as userName, a.password , b.authority, c.client_id as clientId, c.role_id as roleId | |||
select a.id as userId, | |||
a.username as userName, | |||
a.password, | |||
b.authority, | |||
c.client_id as clientId, | |||
c.role_id as roleId, | |||
a.is_able as isAble, | |||
a.is_expire as isExpire | |||
from users a | |||
left join authorities b on a.id = b.user_id | |||
left join t_client_user_role c on a.id = c.user_id |
@@ -33,5 +33,6 @@ com\tuoheng\model\dto\UserBaseInfoDto.class | |||
com\tuoheng\oauth2\authentication\OAuth2EndpointUtils.class | |||
com\tuoheng\model\param\CreateUserDto.class | |||
com\tuoheng\oauth2\authentication\OAuth2ResourceOwnerPasswordAuthenticationProvider.class | |||
com\tuoheng\model\dto\AuthoritiesDto.class | |||
com\tuoheng\service\OidcUserInfoService.class | |||
com\tuoheng\model\param\GetUserInfoDto.class |
@@ -14,6 +14,7 @@ D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_server\src\main\java\com\tuoheng\ | |||
D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_server\src\main\java\com\tuoheng\model\dto\ClientRoleDto.java | |||
D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_server\src\main\java\com\tuoheng\oauth2\authentication\OAuth2ResourceOwnerPasswordAuthenticationProvider.java | |||
D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_server\src\main\java\com\tuoheng\mapper\AuthoritiesMapper.java | |||
D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_server\src\main\java\com\tuoheng\model\dto\AuthoritiesDto.java | |||
D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_server\src\main\java\com\tuoheng\oauth2\authentication\OAuth2ResourceOwnerPasswordAuthenticationToken.java | |||
D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_server\src\main\java\com\tuoheng\model\param\CreateUserDto.java | |||
D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_server\src\main\java\com\tuoheng\model\po\AuthoritiesPo.java |