diff --git a/sql/mysql/youlai_admin.sql b/sql/mysql/youlai_admin.sql index 6b39cbbd..e123baa8 100644 --- a/sql/mysql/youlai_admin.sql +++ b/sql/mysql/youlai_admin.sql @@ -313,7 +313,7 @@ INSERT INTO `sys_role_menu` VALUES (2, 230), (2, 2301), (2, 2302), (2, 2303), (2 INSERT INTO `sys_role_menu` VALUES (2, 240), (2, 2401), (2, 2402), (2, 2403), (2, 2404); INSERT INTO `sys_role_menu` VALUES (2, 250), (2, 2501), (2, 2502), (2, 2503), (2, 2504); INSERT INTO `sys_role_menu` VALUES (2, 251), (2, 2511), (2, 2512), (2, 2513), (2, 2514); -INSERT INTO `sys_role_menu` VALUES (2, 260); +INSERT INTO `sys_role_menu` VALUES (2, 260), (2, 2601); INSERT INTO `sys_role_menu` VALUES (2, 270), (2, 2701), (2, 2702), (2, 2703), (2, 2704), (2, 2705); INSERT INTO `sys_role_menu` VALUES (2, 280), (2, 2801), (2, 2802), (2, 2803), (2, 2804), (2, 2805), (2, 2806); diff --git a/sql/mysql/youlai_admin_template.sql b/sql/mysql/youlai_admin_template.sql index ab691bd8..c1764792 100644 --- a/sql/mysql/youlai_admin_template.sql +++ b/sql/mysql/youlai_admin_template.sql @@ -280,7 +280,7 @@ INSERT INTO `sys_role_menu` VALUES (2, 230), (2, 2301), (2, 2302), (2, 2303), (2 INSERT INTO `sys_role_menu` VALUES (2, 240), (2, 2401), (2, 2402), (2, 2403), (2, 2404); INSERT INTO `sys_role_menu` VALUES (2, 250), (2, 2501), (2, 2502), (2, 2503), (2, 2504); INSERT INTO `sys_role_menu` VALUES (2, 251), (2, 2511), (2, 2512), (2, 2513), (2, 2514); -INSERT INTO `sys_role_menu` VALUES (2, 260); +INSERT INTO `sys_role_menu` VALUES (2, 260), (2, 2601); INSERT INTO `sys_role_menu` VALUES (2, 270), (2, 2701), (2, 2702), (2, 2703), (2, 2704), (2, 2705); INSERT INTO `sys_role_menu` VALUES (2, 280), (2, 2801), (2, 2802), (2, 2803), (2, 2804), (2, 2805), (2, 2806); diff --git a/src/main/java/com/youlai/boot/security/util/SecurityUtils.java b/src/main/java/com/youlai/boot/security/util/SecurityUtils.java index cbe21b20..5a723cd0 100644 --- a/src/main/java/com/youlai/boot/security/util/SecurityUtils.java +++ b/src/main/java/com/youlai/boot/security/util/SecurityUtils.java @@ -4,6 +4,7 @@ import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.util.StrUtil; import com.youlai.boot.common.constant.SecurityConstants; import com.youlai.boot.common.constant.SystemConstants; +import com.youlai.boot.security.model.RoleDataScope; import com.youlai.boot.security.model.SysUserDetails; import jakarta.servlet.http.HttpServletRequest; import org.springframework.http.HttpHeaders; @@ -70,6 +71,15 @@ public class SecurityUtils { return getUser().map(SysUserDetails::getDeptId).orElse(null); } + /** + * 获取数据权限列表 + * + * @return 数据权限列表 + */ + public static List getDataScopes() { + return getUser().map(SysUserDetails::getDataScopes).orElse(List.of()); + } + /** * 获取角色集合 * diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml index f50ab8de..e6ce16d2 100644 --- a/src/main/resources/application-dev.yml +++ b/src/main/resources/application-dev.yml @@ -10,7 +10,7 @@ spring: password: 123456 data: redis: - database: 11 + database: 12 host: www.youlai.tech port: 6379 password: 123456 @@ -216,5 +216,5 @@ captcha: # 微信小程序配置 wx: miniapp: - appid: xxxxxxx - secret: xxxxxxx + appid: Your_AppId + secret: Your_AppSecret diff --git a/src/main/resources/application-prod.yml b/src/main/resources/application-prod.yml index de79b370..30a680db 100644 --- a/src/main/resources/application-prod.yml +++ b/src/main/resources/application-prod.yml @@ -214,5 +214,5 @@ captcha: # 微信小程配置 wx: miniapp: - app-id: xxxxxx - app-secret: xxxxxx + app-id: Your_AppId + app-secret: Your_AppSecret