diff --git "a/db-file/2.0\347\211\210\346\234\254/opsli-boot.sql" "b/db-file/2.0\347\211\210\346\234\254/opsli-boot.sql" index 52001821047d0f5ada0beffb59e8d226690293f5..2566278cd20e39af6c27a1389a9977dc64340f1f 100644 --- "a/db-file/2.0\347\211\210\346\234\254/opsli-boot.sql" +++ "b/db-file/2.0\347\211\210\346\234\254/opsli-boot.sql" @@ -4499,14 +4499,14 @@ CREATE TABLE `sys_user` ( -- Records of sys_user -- ---------------------------- BEGIN; -INSERT INTO `sys_user` VALUES (1, 'system', 'TS{MTY1OTM2NzA0MjMzOA==}$2a$10$FtVMZrf/LeM4ikU2ZXO8XuhmRDpJmIxLVm6Fa3ZEM8jVgZ2CFhuH6', '2', '1', '超级管理员', '15321010110', '112', 'http://upload.bedebug.com/20220802/1660928576913664278HC1G.jpg', '', 'meet.parker@foxmail.com', '没有自学能力的人没有未来', '', '0', '0', 0, '1', '0', 95, 1, '2020-09-25 15:03:22', 1, '2021-05-04 01:59:11', '2022-08-02 15:29:33'); -INSERT INTO `sys_user` VALUES (1313694379541635074, 'demo', 'TS{MTY1ODI5ODUzMzMwOA==}$2a$10$TS0LnHPhQT87rEpFi1A60.BeTQ80vCRGGL.5CPTqb61eCzP8HzueK', '2', '1', '租户内部管理员', '15311111111', 'test_001', 'http://upload.bedebug.com/20211013/1635589382475625280EW3N.jpg', '', 'meet.parker1@foxmail.com', NULL, NULL, '1', '0', 1, '0', '0', 6, 1, '2020-10-06 23:15:22', 1465879900211294210, '2021-12-01 16:42:13', '2022-07-27 13:49:16'); -INSERT INTO `sys_user` VALUES (1315218541317750785, 'zhangsan', 'TS{MTY1ODI5ODUzMzMwOA==}$2a$10$TS0LnHPhQT87rEpFi1A60.BeTQ80vCRGGL.5CPTqb61eCzP8HzueK', '2', '1', '张三', NULL, '123123', NULL, '', NULL, NULL, NULL, '1', '0', 1, '0', '0', 3, 1, '2020-10-11 17:11:50', 1, '2021-06-11 17:44:11', '2022-07-20 14:30:20'); -INSERT INTO `sys_user` VALUES (1315224823500120066, 'lyf', 'TS{MTY1ODI5ODUzMzMwOA==}$2a$10$TS0LnHPhQT87rEpFi1A60.BeTQ80vCRGGL.5CPTqb61eCzP8HzueK', '2', '1', '刘亦菲', NULL, '0101001', NULL, '', NULL, NULL, NULL, '1', '0', 1, '0', '0', 0, 1313694379541635074, '2020-10-11 17:36:48', 1313694379541635074, '2020-10-11 17:36:48', '2022-07-20 14:30:20'); -INSERT INTO `sys_user` VALUES (1465171199435362305, 'admin', 'TS{MTY1OTM2NDMzMzM5Nw==}$2a$10$2GTqJeztWRLOYDoB2EStm.FoncwpHG4GGtieD7qZbND1.cwjXx34u', '2', '1', '系统管理员', NULL, '01001', NULL, '', NULL, NULL, NULL, '1', '0', 0, '1', '0', 6, 1, '2021-11-29 12:10:10', 1, '2022-07-26 20:16:02', '2022-08-01 22:32:13'); -INSERT INTO `sys_user` VALUES (1465879900211294210, 'tenant', 'TS{MTY1ODI5ODUzMzMwOA==}$2a$10$TS0LnHPhQT87rEpFi1A60.BeTQ80vCRGGL.5CPTqb61eCzP8HzueK', '2', '1', '租户管理员', '15300000000', '123123', NULL, '', 'meet.parker2@foxmail.com', NULL, NULL, '0', '1', 1, '0', '0', 1, 1, '2021-12-01 11:06:17', 1, '2021-12-01 11:06:53', '2022-07-27 13:49:20'); -INSERT INTO `sys_user` VALUES (1465886867659096066, 'dept', 'TS{MTY1ODI5ODUzMzMwOA==}$2a$10$TS0LnHPhQT87rEpFi1A60.BeTQ80vCRGGL.5CPTqb61eCzP8HzueK', '2', '1', '部门管理员', NULL, '123213213', NULL, '', NULL, NULL, NULL, '1', '0', 1, '0', '0', 0, 1313694379541635074, '2021-12-01 11:33:59', 1313694379541635074, '2021-12-01 11:33:59', '2022-07-20 14:30:20'); -INSERT INTO `sys_user` VALUES (1465991640378986498, 'songyi', 'TS{MTY1ODI5ODUzMzMwOA==}$2a$10$TS0LnHPhQT87rEpFi1A60.BeTQ80vCRGGL.5CPTqb61eCzP8HzueK', '2', '1', '宋轶', NULL, '432431', NULL, '', NULL, NULL, NULL, '1', '0', 1, '0', '0', 0, 1465886867659096066, '2021-12-01 18:30:19', 1465886867659096066, '2021-12-01 18:30:19', '2022-07-20 14:30:20'); +INSERT INTO `sys_user`(`id`, `username`, `password`, `password_level`, `enable`, `real_name`, `mobile`, `no`, `avatar`, `login_ip`, `email`, `sign`, `remark`, `iz_exist_org`, `iz_tenant_admin`, `tenant_id`, `enable_switch_tenant`, `deleted`, `version`, `create_by`, `create_time`, `update_by`, `update_time`, `ts`) VALUES (1, 'system', 'TS{MTY1OTM2NzA0MjMzOA==}$2a$10$FtVMZrf/LeM4ikU2ZXO8XuhmRDpJmIxLVm6Fa3ZEM8jVgZ2CFhuH6', '2', '1', '超级管理员', '15321010110', '112', 'http://upload.bedebug.com/20220802/1660928576913664278HC1G.jpg', '', 'meet.parker@foxmail.com', '没有自学能力的人没有未来', '', '0', '0', 0, '1', '0', 95, 1, '2020-09-25 15:03:22', 1, '2021-05-04 01:59:11', '2022-08-02 15:29:33'); +INSERT INTO `sys_user`(`id`, `username`, `password`, `password_level`, `enable`, `real_name`, `mobile`, `no`, `avatar`, `login_ip`, `email`, `sign`, `remark`, `iz_exist_org`, `iz_tenant_admin`, `tenant_id`, `enable_switch_tenant`, `deleted`, `version`, `create_by`, `create_time`, `update_by`, `update_time`, `ts`) VALUES (1313694379541635074, 'demo', 'TS{MTY1ODI5ODUzMzMwOA==}$2a$10$TS0LnHPhQT87rEpFi1A60.BeTQ80vCRGGL.5CPTqb61eCzP8HzueK', '2', '1', '租户内部管理员', '13301225424', 'test_001', 'http://upload.bedebug.com/20220809/1660188426197843638MXWG.jpg', '', 'meet.parker1@foxmail.com', NULL, NULL, '1', '0', 1, '0', '0', 6, 1, '2020-10-06 23:15:22', 1465879900211294210, '2021-12-01 16:42:13', '2022-08-09 13:55:05'); +INSERT INTO `sys_user`(`id`, `username`, `password`, `password_level`, `enable`, `real_name`, `mobile`, `no`, `avatar`, `login_ip`, `email`, `sign`, `remark`, `iz_exist_org`, `iz_tenant_admin`, `tenant_id`, `enable_switch_tenant`, `deleted`, `version`, `create_by`, `create_time`, `update_by`, `update_time`, `ts`) VALUES (1315218541317750785, 'zhangsan', 'TS{MTY1ODI5ODUzMzMwOA==}$2a$10$TS0LnHPhQT87rEpFi1A60.BeTQ80vCRGGL.5CPTqb61eCzP8HzueK', '2', '1', '张三', '55555555555', '123123', NULL, '', 'meet.parker3@foxmail.com', NULL, NULL, '1', '0', 1, '0', '0', 3, 1, '2020-10-11 17:11:50', 1, '2021-06-11 17:44:11', '2022-08-09 14:01:18'); +INSERT INTO `sys_user`(`id`, `username`, `password`, `password_level`, `enable`, `real_name`, `mobile`, `no`, `avatar`, `login_ip`, `email`, `sign`, `remark`, `iz_exist_org`, `iz_tenant_admin`, `tenant_id`, `enable_switch_tenant`, `deleted`, `version`, `create_by`, `create_time`, `update_by`, `update_time`, `ts`) VALUES (1315224823500120066, 'lyf', 'TS{MTY1ODI5ODUzMzMwOA==}$2a$10$TS0LnHPhQT87rEpFi1A60.BeTQ80vCRGGL.5CPTqb61eCzP8HzueK', '2', '1', '刘亦菲', '44444444444', '0101001', NULL, '', 'meet.parker4@foxmail.com', NULL, NULL, '1', '0', 1, '0', '0', 0, 1313694379541635074, '2020-10-11 17:36:48', 1313694379541635074, '2020-10-11 17:36:48', '2022-08-09 14:01:22'); +INSERT INTO `sys_user`(`id`, `username`, `password`, `password_level`, `enable`, `real_name`, `mobile`, `no`, `avatar`, `login_ip`, `email`, `sign`, `remark`, `iz_exist_org`, `iz_tenant_admin`, `tenant_id`, `enable_switch_tenant`, `deleted`, `version`, `create_by`, `create_time`, `update_by`, `update_time`, `ts`) VALUES (1465171199435362305, 'admin', 'TS{MTY1OTM2NDMzMzM5Nw==}$2a$10$2GTqJeztWRLOYDoB2EStm.FoncwpHG4GGtieD7qZbND1.cwjXx34u', '2', '1', '系统管理员', '33333333333', '01001', 'http://upload.bedebug.com/20220809/16605552760947393781AWR.jpg', '', 'meet.parker5@foxmail.com', NULL, NULL, '1', '0', 0, '1', '0', 6, 1, '2021-11-29 12:10:10', 1, '2022-07-26 20:16:02', '2022-08-09 14:01:26'); +INSERT INTO `sys_user`(`id`, `username`, `password`, `password_level`, `enable`, `real_name`, `mobile`, `no`, `avatar`, `login_ip`, `email`, `sign`, `remark`, `iz_exist_org`, `iz_tenant_admin`, `tenant_id`, `enable_switch_tenant`, `deleted`, `version`, `create_by`, `create_time`, `update_by`, `update_time`, `ts`) VALUES (1465879900211294210, 'tenant', 'TS{MTY1ODI5ODUzMzMwOA==}$2a$10$TS0LnHPhQT87rEpFi1A60.BeTQ80vCRGGL.5CPTqb61eCzP8HzueK', '2', '1', '租户管理员', '17310558930', '123123', 'http://upload.bedebug.com/20220809/166121046267039280RQ81U.jpg', '', 'meet.parker2@foxmail.com', NULL, NULL, '0', '1', 1, '0', '0', 1, 1, '2021-12-01 11:06:17', 1, '2021-12-01 11:06:53', '2022-08-09 13:55:40'); +INSERT INTO `sys_user`(`id`, `username`, `password`, `password_level`, `enable`, `real_name`, `mobile`, `no`, `avatar`, `login_ip`, `email`, `sign`, `remark`, `iz_exist_org`, `iz_tenant_admin`, `tenant_id`, `enable_switch_tenant`, `deleted`, `version`, `create_by`, `create_time`, `update_by`, `update_time`, `ts`) VALUES (1465886867659096066, 'dept', 'TS{MTY1ODI5ODUzMzMwOA==}$2a$10$TS0LnHPhQT87rEpFi1A60.BeTQ80vCRGGL.5CPTqb61eCzP8HzueK', '2', '1', '部门管理员', '22222222222', '123213213', 'http://upload.bedebug.com/20220809/16610489376695984679HUA.jpg', '', 'meet.parker6@foxmail.com', NULL, NULL, '1', '0', 1, '0', '0', 0, 1313694379541635074, '2021-12-01 11:33:59', 1313694379541635074, '2021-12-01 11:33:59', '2022-08-09 14:01:30'); +INSERT INTO `sys_user`(`id`, `username`, `password`, `password_level`, `enable`, `real_name`, `mobile`, `no`, `avatar`, `login_ip`, `email`, `sign`, `remark`, `iz_exist_org`, `iz_tenant_admin`, `tenant_id`, `enable_switch_tenant`, `deleted`, `version`, `create_by`, `create_time`, `update_by`, `update_time`, `ts`) VALUES (1465991640378986498, 'songyi', 'TS{MTY1ODI5ODUzMzMwOA==}$2a$10$TS0LnHPhQT87rEpFi1A60.BeTQ80vCRGGL.5CPTqb61eCzP8HzueK', '2', '1', '宋轶', '11111111111', '432431', 'http://upload.bedebug.com/20220809/1661003971159749330PV6N.jpg', '', 'meet.parker7@foxmail.com', NULL, NULL, '1', '0', 1, '0', '0', 0, 1465886867659096066, '2021-12-01 18:30:19', 1465886867659096066, '2021-12-01 18:30:19', '2022-08-09 14:01:33'); COMMIT; -- ---------------------------- diff --git a/opsli-base-support/opsli-core/src/main/java/org/opsli/core/autoconfigure/conf/SecurityConfig.java b/opsli-base-support/opsli-core/src/main/java/org/opsli/core/autoconfigure/conf/SecurityConfig.java index 84039da2940f355b6f4a7b566a4f7ffff5c421e6..7351a134101cfeb2d7663af84dde06dea187de02 100644 --- a/opsli-base-support/opsli-core/src/main/java/org/opsli/core/autoconfigure/conf/SecurityConfig.java +++ b/opsli-base-support/opsli-core/src/main/java/org/opsli/core/autoconfigure/conf/SecurityConfig.java @@ -67,7 +67,11 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter { .frameOptions().disable() .and() // 关闭csrf token认证不需要csrf防护 - .csrf().disable(); + .csrf().disable() + // 关闭Session会话管理器 JWT 不需要 + .sessionManagement().disable() + // 关闭记住我功能 JWT 不需要 + .rememberMe().disable(); // 初始化 initAuthorizeRequests this.initAuthorizeRequests(http); @@ -78,15 +82,6 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter { * @param http http */ private void initAuthorizeRequests(HttpSecurity http) throws Exception { - // 设置URL 未登陆前可访问URL - List anonymousList = authProperties.getUrlExclusion().getAnonymous(); - if(null != anonymousList){ - String[] urlExclusionArray = anonymousList.toArray(new String[0]); - http.authorizeRequests() - // URL 未登陆前可访问 - .antMatchers(urlExclusionArray).anonymous(); - } - // 设置URL白名单 List permitAll = authProperties.getUrlExclusion().getPermitAll(); if(null != permitAll){ @@ -105,6 +100,8 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter { http.addFilterBefore(new JwtAuthenticationTokenFilter(uidUserDetailDetailService), UsernamePasswordAuthenticationFilter.class); + + // 异常处理 http.exceptionHandling() .accessDeniedHandler(accessDeniedHandler) diff --git a/opsli-modulars/opsli-modulars-system/src/main/java/org/opsli/modulars/system/dict/service/impl/DictDetailServiceImpl.java b/opsli-modulars/opsli-modulars-system/src/main/java/org/opsli/modulars/system/dict/service/impl/DictDetailServiceImpl.java index 93b603f12354c7e907a75ec882d60cbc280d2319..60b4e8cec76a0c9f2ff27444aabe3ee508e2b085 100644 --- a/opsli-modulars/opsli-modulars-system/src/main/java/org/opsli/modulars/system/dict/service/impl/DictDetailServiceImpl.java +++ b/opsli-modulars/opsli-modulars-system/src/main/java/org/opsli/modulars/system/dict/service/impl/DictDetailServiceImpl.java @@ -37,6 +37,7 @@ import org.opsli.modulars.system.dict.mapper.DictDetailMapper; import org.opsli.modulars.system.dict.service.IDictDetailService; import org.opsli.modulars.system.dict.service.IDictService; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Lazy; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -54,6 +55,8 @@ public class DictDetailServiceImpl extends CrudServiceImpl implements IUserService { diff --git a/opsli-plugins/opsli-plugins-security/src/main/java/org/opsli/plugins/security/properties/AuthProperties.java b/opsli-plugins/opsli-plugins-security/src/main/java/org/opsli/plugins/security/properties/AuthProperties.java index 8e91c938fa5a3e7ed0282aebbe69bd0ab399b8fa..44cc0e695ec6b50dc857dddd7475d01627fc1e7d 100644 --- a/opsli-plugins/opsli-plugins-security/src/main/java/org/opsli/plugins/security/properties/AuthProperties.java +++ b/opsli-plugins/opsli-plugins-security/src/main/java/org/opsli/plugins/security/properties/AuthProperties.java @@ -45,9 +45,6 @@ public class AuthProperties { @Data public static class UrlExclusion { - /** 未登陆状态下可以访问 */ - private List anonymous; - /** 无限制 */ private List permitAll; diff --git a/opsli-starter/src/main/resources/application.yaml b/opsli-starter/src/main/resources/application.yaml index ad2db14eaebdbfab00b016b811766269f7dd0546..098d489a6c497d7897f1f045e87cbdb0601ed864 100644 --- a/opsli-starter/src/main/resources/application.yaml +++ b/opsli-starter/src/main/resources/application.yaml @@ -164,17 +164,7 @@ opsli: credentials-expired: -1 # 排除过滤URL url-exclusion: - # 未登陆状态下可以访问 - anonymous: - - "/captcha" - - "/system/slipCount" - - "/system/login" - - "/system/login-by-code" - # 无限制 permit-all: - - "/api/*/common/public-key" - - "/api/*/common/email/create-code" - - "/api/*/common/mobile/create-code" - "/swagger-ui.html" - "/doc.html" - "/swagger-resources/**" @@ -183,6 +173,13 @@ opsli: - "/swagger/**" - "/v2/api-docs" - "/druid/**" + - "/captcha" + - "/system/slipCount" + - "/system/login" + - "/system/login-by-code" + - "/api/*/common/public-key" + - "/api/*/common/email/create-code" + - "/api/*/common/mobile/create-code" # 超级管理员账号 super-admin: system