前端服务共享
This commit is contained in:
@@ -31,7 +31,7 @@ log() {
|
||||
# 数据库连接信息(可通过环境变量覆盖)
|
||||
DB_HOST=${POSTGRES_HOST:-"localhost"}
|
||||
DB_PORT=${POSTGRES_PORT:-"5432"}
|
||||
DB_NAME=${POSTGRES_DB:-"urban-lifeline"}
|
||||
DB_NAME=${POSTGRES_DB:-"urban_lifeline"}
|
||||
DB_USER=${POSTGRES_USER:-"postgres"}
|
||||
DB_PASSWORD=${POSTGRES_PASSWORD:-"postgres"}
|
||||
|
||||
|
||||
@@ -12,12 +12,13 @@ CREATE DATABASE urban_lifeline
|
||||
LC_CTYPE 'zh_CN.UTF-8';
|
||||
|
||||
-- 连接到新创建的数据库
|
||||
\c urban-lifeline;
|
||||
\c urban_lifeline;
|
||||
|
||||
-- -- 创建扩展(如果需要)
|
||||
CREATE EXTENSION IF NOT EXISTS "uuid-ossp"; -- UUID 支持
|
||||
CREATE EXTENSION IF NOT EXISTS "pg_trgm"; -- 文本搜索支持
|
||||
CREATE EXTENSION IF NOT EXISTS "btree_gist"; -- GiST 索引支持
|
||||
CREATE EXTENSION IF NOT EXISTS "vector"; -- 向量
|
||||
|
||||
-- 设置搜索路径(可选,但建议设置)
|
||||
-- ALTER DATABASE urban-lifeline SET search_path TO sys, public;
|
||||
|
||||
@@ -158,8 +158,11 @@ CREATE TABLE sys.tb_sys_view (
|
||||
url VARCHAR(255) DEFAULT NULL, -- 视图URL
|
||||
component VARCHAR(255) DEFAULT NULL, -- 视图组件
|
||||
icon VARCHAR(100) DEFAULT NULL, -- 视图图标
|
||||
type INTEGER DEFAULT 0, -- 视图类型
|
||||
layout VARCHAR(100) DEFAULT NULL, -- 布局组件路径名称
|
||||
type INTEGER DEFAULT 0, -- 视图类型:0=目录 1=菜单页面 2=按钮
|
||||
view_type VARCHAR(20) DEFAULT 'route', -- 页面类型:route=路由页面 iframe=嵌入页面
|
||||
iframe_url VARCHAR(500) DEFAULT NULL, -- iframe URL(仅当view_type=iframe时有效)
|
||||
service VARCHAR(20) DEFAULT 'platform', -- 所属服务:platform=平台应用 bidding=招标应用 workcase=客服应用
|
||||
layout VARCHAR(100) DEFAULT NULL, -- 布局组件路径名称
|
||||
order_num INTEGER DEFAULT 0, -- 视图排序号
|
||||
dept_path VARCHAR(255) DEFAULT NULL, -- 部门全路径
|
||||
description VARCHAR(255) DEFAULT NULL, -- 视图描述
|
||||
@@ -172,7 +175,11 @@ CREATE TABLE sys.tb_sys_view (
|
||||
PRIMARY KEY (view_id),
|
||||
UNIQUE (optsn)
|
||||
);
|
||||
COMMENT ON TABLE sys.tb_sys_view IS '视图表';
|
||||
-- 创建索引
|
||||
CREATE INDEX idx_sys_view_parent ON sys.tb_sys_view USING btree (parent_id) WHERE deleted = false;
|
||||
CREATE INDEX idx_sys_view_service ON sys.tb_sys_view USING btree (service) WHERE deleted = false;
|
||||
CREATE INDEX idx_sys_view_type ON sys.tb_sys_view USING btree (view_type) WHERE deleted = false;
|
||||
COMMENT ON TABLE sys.tb_sys_view IS '视图表(菜单表)';
|
||||
COMMENT ON COLUMN sys.tb_sys_view.optsn IS '流水号';
|
||||
COMMENT ON COLUMN sys.tb_sys_view.view_id IS '视图ID';
|
||||
COMMENT ON COLUMN sys.tb_sys_view.name IS '视图名称';
|
||||
@@ -180,7 +187,10 @@ COMMENT ON COLUMN sys.tb_sys_view.parent_id IS '父视图ID';
|
||||
COMMENT ON COLUMN sys.tb_sys_view.url IS '视图URL';
|
||||
COMMENT ON COLUMN sys.tb_sys_view.component IS '视图组件';
|
||||
COMMENT ON COLUMN sys.tb_sys_view.icon IS '视图图标';
|
||||
COMMENT ON COLUMN sys.tb_sys_view.type IS '视图类型';
|
||||
COMMENT ON COLUMN sys.tb_sys_view.type IS '视图类型:0=目录 1=菜单页面 2=按钮';
|
||||
COMMENT ON COLUMN sys.tb_sys_view.view_type IS '页面类型:route=路由页面 iframe=嵌入页面';
|
||||
COMMENT ON COLUMN sys.tb_sys_view.iframe_url IS 'iframe URL(仅当view_type=iframe时有效)';
|
||||
COMMENT ON COLUMN sys.tb_sys_view.service IS '所属服务:platform=平台应用 bidding=招标应用 workcase=客服应用';
|
||||
COMMENT ON COLUMN sys.tb_sys_view.layout IS '布局组件路径名称';
|
||||
COMMENT ON COLUMN sys.tb_sys_view.order_num IS '视图排序号';
|
||||
COMMENT ON COLUMN sys.tb_sys_view.description IS '视图描述';
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
\i createTableBidding.sql
|
||||
|
||||
-- 8. 智能客服业务模块
|
||||
\i createTableCustomerService.sql
|
||||
\i createTableWorkcase.sql
|
||||
|
||||
-- 9. 智能体模块(暂不启用)
|
||||
-- \i createTableAgent.sql
|
||||
|
||||
@@ -59,7 +59,7 @@ INSERT INTO sys.tb_sys_module (
|
||||
('MODULE-0006', 'module_bidding', '招投标', '招投标业务管理',
|
||||
'system', NULL, now(), false),
|
||||
|
||||
('MODULE-0007', 'module_customer_service', '智能客服', '客服工单管理',
|
||||
('MODULE-0007', 'module_workcase', '智能客服', '客服工单管理',
|
||||
'system', NULL, now(), false);
|
||||
|
||||
-- =============================
|
||||
@@ -144,6 +144,18 @@ INSERT INTO sys.tb_sys_permission (
|
||||
('PERM-0401', 'perm_log_view', '日志查看', 'log:log:view', '查看系统日志', 'module_system',
|
||||
true, 'system', NULL, now(), false),
|
||||
('PERM-0402', 'perm_log_export', '日志导出', 'log:log:export', '导出系统日志数据', 'module_system',
|
||||
true, 'system', NULL, now(), false),
|
||||
|
||||
-- 平台基础菜单访问权限(所有登录用户都有)
|
||||
('PERM-0501', 'perm_platform_home', '工作台访问', 'platform:home:view', '访问平台工作台', 'module_system',
|
||||
true, 'system', NULL, now(), false),
|
||||
('PERM-0502', 'perm_platform_chat', 'AI助手访问', 'platform:chat:view', '访问AI助手', 'module_system',
|
||||
true, 'system', NULL, now(), false),
|
||||
('PERM-0503', 'perm_platform_bidding', '招标助手访问', 'platform:bidding:view', '访问招标助手(iframe)', 'module_bidding',
|
||||
true, 'system', NULL, now(), false),
|
||||
('PERM-0504', 'perm_platform_workcase', '泰豪小电访问', 'platform:workcase:view', '访问泰豪小电客服(iframe)', 'module_workcase',
|
||||
true, 'system', NULL, now(), false),
|
||||
('PERM-0505', 'perm_platform_workflow', '智能体编排访问', 'platform:workflow:view', '访问智能体编排(iframe)', 'module_system',
|
||||
true, 'system', NULL, now(), false);
|
||||
|
||||
-- =============================
|
||||
@@ -151,36 +163,84 @@ INSERT INTO sys.tb_sys_permission (
|
||||
-- =============================
|
||||
INSERT INTO sys.tb_sys_view (
|
||||
optsn, view_id, name, parent_id, url, component, icon, type,
|
||||
layout, order_num, description, creator, create_time, deleted
|
||||
view_type, iframe_url, service, layout, order_num, description,
|
||||
creator, create_time, deleted
|
||||
) VALUES
|
||||
-- =========================
|
||||
-- 平台应用菜单 (platform)
|
||||
-- =========================
|
||||
-- 一级菜单
|
||||
('VIEW-0001', 'view_system', '系统管理', NULL, '/system', NULL, 'Settings', 0,
|
||||
'MainLayout', 100, '系统管理菜单', 'system', now(), false),
|
||||
('VIEW-P001', 'view_platform_home', '工作台', NULL, '/home', 'Home', 'Grid', 1,
|
||||
'route', NULL, 'platform', 'SidebarLayout', 10, '平台工作台首页', 'system', now(), false),
|
||||
|
||||
('VIEW-0002', 'view_business', '业务管理', NULL, '/business', NULL, 'Briefcase', 0,
|
||||
'MainLayout', 200, '业务管理菜单', 'system', now(), false),
|
||||
('VIEW-P002', 'view_platform_chat', 'AI助手', NULL, '/chat', 'Chat', 'ChatDotRound', 1,
|
||||
'route', NULL, 'platform', 'SidebarLayout', 20, 'AI智能对话助手', 'system', now(), false),
|
||||
|
||||
-- iframe 嵌入菜单
|
||||
('VIEW-P003', 'view_platform_bidding', '招标助手', NULL, NULL, NULL, 'Document', 1,
|
||||
'iframe', 'http://localhost:5002', 'platform', 'SidebarLayout', 30, '招标应用(iframe)', 'system', now(), false),
|
||||
|
||||
('VIEW-P004', 'view_platform_workcase', '泰豪小电', NULL, NULL, NULL, 'Service', 1,
|
||||
'iframe', 'http://localhost:5003', 'platform', 'SidebarLayout', 40, '客服应用(iframe)', 'system', now(), false),
|
||||
|
||||
('VIEW-P005', 'view_platform_workflow', '智能体编排', NULL, NULL, NULL, 'Connection', 1,
|
||||
'iframe', 'http://localhost:3000', 'platform', 'SidebarLayout', 50, 'Dify智能体编排(iframe)', 'system', now(), false),
|
||||
|
||||
-- 系统管理目录
|
||||
('VIEW-P100', 'view_system', '系统管理', NULL, '/system', NULL, 'Settings', 0,
|
||||
'route', NULL, 'platform', 'SidebarLayout', 100, '系统管理目录', 'system', now(), false),
|
||||
|
||||
-- 系统管理子菜单
|
||||
('VIEW-0101', 'view_user', '用户管理', 'view_system', '/system/user', 'system/UserList', 'Users', 1,
|
||||
'MainLayout', 10, '用户管理页面', 'system', now(), false),
|
||||
('VIEW-P101', 'view_user', '用户管理', 'view_system', '/system/user', 'system/UserList', 'Users', 1,
|
||||
'route', NULL, 'platform', 'SidebarLayout', 10, '用户管理页面', 'system', now(), false),
|
||||
|
||||
('VIEW-0102', 'view_role', '角色管理', 'view_system', '/system/role', 'system/RoleList', 'Shield', 1,
|
||||
'MainLayout', 20, '角色管理页面', 'system', now(), false),
|
||||
('VIEW-P102', 'view_role', '角色管理', 'view_system', '/system/role', 'system/RoleList', 'Shield', 1,
|
||||
'route', NULL, 'platform', 'SidebarLayout', 20, '角色管理页面', 'system', now(), false),
|
||||
|
||||
('VIEW-0103', 'view_dept', '部门管理', 'view_system', '/system/dept', 'system/DeptList', 'Building', 1,
|
||||
'MainLayout', 30, '部门管理页面', 'system', now(), false),
|
||||
('VIEW-P103', 'view_dept', '部门管理', 'view_system', '/system/dept', 'system/DeptList', 'Building', 1,
|
||||
'route', NULL, 'platform', 'SidebarLayout', 30, '部门管理页面', 'system', now(), false),
|
||||
|
||||
('VIEW-0104', 'view_permission', '权限管理', 'view_system', '/system/permission', 'system/PermissionList', 'Lock', 1,
|
||||
'MainLayout', 40, '权限管理页面', 'system', now(), false),
|
||||
('VIEW-P104', 'view_permission', '权限管理', 'view_system', '/system/permission', 'system/PermissionList', 'Lock', 1,
|
||||
'route', NULL, 'platform', 'SidebarLayout', 40, '权限管理页面', 'system', now(), false),
|
||||
|
||||
('VIEW-0105', 'view_config', '配置管理', 'view_system', '/system/config', 'system/ConfigList', 'Settings', 1,
|
||||
'MainLayout', 50, '配置管理页面', 'system', now(), false),
|
||||
('VIEW-P105', 'view_config', '配置管理', 'view_system', '/system/config', 'system/ConfigList', 'Settings', 1,
|
||||
'route', NULL, 'platform', 'SidebarLayout', 50, '配置管理页面', 'system', now(), false),
|
||||
|
||||
('VIEW-0106', 'view_file', '文件管理', 'view_system', '/system/file', 'system/FileList', 'FileText', 1,
|
||||
'MainLayout', 60, '文件管理页面', 'system', now(), false),
|
||||
('VIEW-P106', 'view_file', '文件管理', 'view_system', '/system/file', 'system/FileList', 'FileText', 1,
|
||||
'route', NULL, 'platform', 'SidebarLayout', 60, '文件管理页面', 'system', now(), false),
|
||||
|
||||
('VIEW-0107', 'view_message', '消息管理', 'view_system', '/system/message', 'system/MessageList', 'Mail', 1,
|
||||
'MainLayout', 70, '消息管理页面', 'system', now(), false);
|
||||
('VIEW-P107', 'view_message', '消息管理', 'view_system', '/system/message', 'system/MessageList', 'Mail', 1,
|
||||
'route', NULL, 'platform', 'SidebarLayout', 70, '消息管理页面', 'system', now(), false),
|
||||
|
||||
-- =========================
|
||||
-- 招标应用菜单 (bidding)
|
||||
-- =========================
|
||||
('VIEW-B001', 'view_bidding_home', '首页', NULL, '/home', 'Home', 'House', 1,
|
||||
'route', NULL, 'bidding', 'DefaultLayout', 10, '招标应用首页', 'system', now(), false),
|
||||
|
||||
('VIEW-B002', 'view_bidding_list', '招标列表', NULL, '/bidding/list', 'bidding/List', 'List', 1,
|
||||
'route', NULL, 'bidding', 'DefaultLayout', 20, '招标项目列表', 'system', now(), false),
|
||||
|
||||
('VIEW-B003', 'view_bidding_detail', '招标详情', NULL, '/bidding/detail', 'bidding/Detail', 'Document', 1,
|
||||
'route', NULL, 'bidding', 'DefaultLayout', 30, '招标项目详情', 'system', now(), false),
|
||||
|
||||
('VIEW-B004', 'view_bidding_offer', '投标管理', NULL, '/bidding/offer', 'bidding/Offer', 'Edit', 1,
|
||||
'route', NULL, 'bidding', 'DefaultLayout', 40, '投标管理页面', 'system', now(), false),
|
||||
|
||||
-- =========================
|
||||
-- 客服应用菜单 (workcase)
|
||||
-- =========================
|
||||
('VIEW-W001', 'view_workcase_home', '首页', NULL, '/home', 'Home', 'House', 1,
|
||||
'route', NULL, 'workcase', 'DefaultLayout', 10, '客服应用首页', 'system', now(), false),
|
||||
|
||||
('VIEW-W002', 'view_workcase_list', '工单列表', NULL, '/workcase/list', 'workcase/List', 'Tickets', 1,
|
||||
'route', NULL, 'workcase', 'DefaultLayout', 20, '工单列表页面', 'system', now(), false),
|
||||
|
||||
('VIEW-W003', 'view_workcase_detail', '工单详情', NULL, '/workcase/detail', 'workcase/Detail', 'Document', 1,
|
||||
'route', NULL, 'workcase', 'DefaultLayout', 30, '工单详情页面', 'system', now(), false),
|
||||
|
||||
('VIEW-W004', 'view_workcase_chat', '智能客服', NULL, '/workcase/chat', 'workcase/Chat', 'ChatDotRound', 1,
|
||||
'route', NULL, 'workcase', 'DefaultLayout', 40, '智能客服聊天', 'system', now(), false);
|
||||
|
||||
-- =============================
|
||||
-- 6. 角色权限关联(超级管理员拥有所有权限)
|
||||
@@ -199,7 +259,7 @@ SELECT
|
||||
FROM sys.tb_sys_permission
|
||||
WHERE deleted = false;
|
||||
|
||||
-- 系统管理员权限(除了用户删除外的系统管理权限)
|
||||
-- 系统管理员权限(除了用户删除外的系统管理权限 + 所有平台基础菜单)
|
||||
INSERT INTO sys.tb_sys_role_permission (
|
||||
optsn, role_id, permission_id, creator, dept_path, create_time, deleted
|
||||
)
|
||||
@@ -214,73 +274,94 @@ SELECT
|
||||
FROM sys.tb_sys_permission
|
||||
WHERE deleted = false
|
||||
AND code NOT IN ('system:user:delete', 'system:role:delete', 'system:dept:delete')
|
||||
AND module_id IN ('module_system', 'module_file', 'module_message', 'module_config');
|
||||
AND (
|
||||
module_id IN ('module_system', 'module_file', 'module_message', 'module_config', 'module_bidding', 'module_workcase')
|
||||
OR code LIKE 'platform:%:view' -- 包含所有平台基础菜单权限
|
||||
);
|
||||
|
||||
-- 普通用户权限(基础查看和文件操作)
|
||||
-- 普通用户权限(基础查看和文件操作 + 平台基础菜单访问)
|
||||
INSERT INTO sys.tb_sys_role_permission (
|
||||
optsn, role_id, permission_id, creator, dept_path, create_time, deleted
|
||||
) VALUES
|
||||
('RP-U-0001', 'role_user', 'perm_user_view', 'system', NULL, now(), false),
|
||||
('RP-U-0002', 'role_user', 'perm_file_view', 'system', NULL, now(), false),
|
||||
('RP-U-0003', 'role_user', 'perm_file_upload', 'system', NULL, now(), false),
|
||||
('RP-U-0004', 'role_user', 'perm_file_download', 'system', NULL, now(), false),
|
||||
('RP-U-0005', 'role_user', 'perm_message_view', 'system', NULL, now(), false),
|
||||
('RP-U-0006', 'role_user', 'perm_config_view', 'system', NULL, now(), false);
|
||||
-- 平台基础菜单访问权限
|
||||
('RP-U-0001', 'role_user', 'perm_platform_home', 'system', NULL, now(), false),
|
||||
('RP-U-0002', 'role_user', 'perm_platform_chat', 'system', NULL, now(), false),
|
||||
('RP-U-0003', 'role_user', 'perm_platform_bidding', 'system', NULL, now(), false),
|
||||
('RP-U-0004', 'role_user', 'perm_platform_workcase', 'system', NULL, now(), false),
|
||||
('RP-U-0005', 'role_user', 'perm_platform_workflow', 'system', NULL, now(), false),
|
||||
-- 系统功能权限
|
||||
('RP-U-0011', 'role_user', 'perm_user_view', 'system', NULL, now(), false),
|
||||
('RP-U-0012', 'role_user', 'perm_file_view', 'system', NULL, now(), false),
|
||||
('RP-U-0013', 'role_user', 'perm_file_upload', 'system', NULL, now(), false),
|
||||
('RP-U-0014', 'role_user', 'perm_file_download', 'system', NULL, now(), false),
|
||||
('RP-U-0015', 'role_user', 'perm_message_view', 'system', NULL, now(), false),
|
||||
('RP-U-0016', 'role_user', 'perm_config_view', 'system', NULL, now(), false);
|
||||
|
||||
-- 访客权限(仅查看)
|
||||
-- 访客权限(仅查看 + 基础菜单访问)
|
||||
INSERT INTO sys.tb_sys_role_permission (
|
||||
optsn, role_id, permission_id, creator, dept_path, create_time, deleted
|
||||
) VALUES
|
||||
('RP-G-0001', 'role_guest', 'perm_user_view', 'system', NULL, now(), false),
|
||||
('RP-G-0002', 'role_guest', 'perm_file_view', 'system', NULL, now(), false),
|
||||
('RP-G-0003', 'role_guest', 'perm_message_view', 'system', NULL, now(), false);
|
||||
-- 平台基础菜单访问权限
|
||||
('RP-G-0001', 'role_guest', 'perm_platform_home', 'system', NULL, now(), false),
|
||||
('RP-G-0002', 'role_guest', 'perm_platform_chat', 'system', NULL, now(), false),
|
||||
-- 系统功能权限(仅查看)
|
||||
('RP-G-0011', 'role_guest', 'perm_user_view', 'system', NULL, now(), false),
|
||||
('RP-G-0012', 'role_guest', 'perm_file_view', 'system', NULL, now(), false),
|
||||
('RP-G-0013', 'role_guest', 'perm_message_view', 'system', NULL, now(), false);
|
||||
|
||||
-- =============================
|
||||
-- 7. 视图权限关联
|
||||
-- =============================
|
||||
-- 将视图与对应模块的权限关联
|
||||
-- 将视图与对应模块的权限关联(使用新的 view_id)
|
||||
INSERT INTO sys.tb_sys_view_permission (
|
||||
optsn, view_id, permission_id, creator, dept_path, create_time, deleted
|
||||
) VALUES
|
||||
-- 用户管理视图关联用户权限
|
||||
('VP-0001', 'view_user', 'perm_user_view', 'system', NULL, now(), false),
|
||||
('VP-0002', 'view_user', 'perm_user_create', 'system', NULL, now(), false),
|
||||
('VP-0003', 'view_user', 'perm_user_edit', 'system', NULL, now(), false),
|
||||
('VP-0004', 'view_user', 'perm_user_delete', 'system', NULL, now(), false),
|
||||
('VP-0005', 'view_user', 'perm_user_export', 'system', NULL, now(), false),
|
||||
-- 平台基础菜单权限关联(所有登录用户都可访问)
|
||||
('VP-P001', 'VIEW-P001', 'perm_platform_home', 'system', NULL, now(), false),
|
||||
('VP-P002', 'VIEW-P002', 'perm_platform_chat', 'system', NULL, now(), false),
|
||||
('VP-P003', 'VIEW-P003', 'perm_platform_bidding', 'system', NULL, now(), false),
|
||||
('VP-P004', 'VIEW-P004', 'perm_platform_workcase', 'system', NULL, now(), false),
|
||||
('VP-P005', 'VIEW-P005', 'perm_platform_workflow', 'system', NULL, now(), false),
|
||||
|
||||
-- 角色管理视图关联角色权限
|
||||
('VP-0011', 'view_role', 'perm_role_view', 'system', NULL, now(), false),
|
||||
('VP-0012', 'view_role', 'perm_role_create', 'system', NULL, now(), false),
|
||||
('VP-0013', 'view_role', 'perm_role_edit', 'system', NULL, now(), false),
|
||||
('VP-0014', 'view_role', 'perm_role_delete', 'system', NULL, now(), false),
|
||||
('VP-0015', 'view_role', 'perm_role_export', 'system', NULL, now(), false),
|
||||
-- 用户管理视图关联用户权限(VIEW-P101)
|
||||
('VP-0001', 'VIEW-P101', 'perm_user_view', 'system', NULL, now(), false),
|
||||
('VP-0002', 'VIEW-P101', 'perm_user_create', 'system', NULL, now(), false),
|
||||
('VP-0003', 'VIEW-P101', 'perm_user_edit', 'system', NULL, now(), false),
|
||||
('VP-0004', 'VIEW-P101', 'perm_user_delete', 'system', NULL, now(), false),
|
||||
('VP-0005', 'VIEW-P101', 'perm_user_export', 'system', NULL, now(), false),
|
||||
|
||||
-- 部门管理视图关联部门权限
|
||||
('VP-0021', 'view_dept', 'perm_dept_view', 'system', NULL, now(), false),
|
||||
('VP-0022', 'view_dept', 'perm_dept_create', 'system', NULL, now(), false),
|
||||
('VP-0023', 'view_dept', 'perm_dept_edit', 'system', NULL, now(), false),
|
||||
('VP-0024', 'view_dept', 'perm_dept_delete', 'system', NULL, now(), false),
|
||||
('VP-0025', 'view_dept', 'perm_dept_export', 'system', NULL, now(), false),
|
||||
-- 角色管理视图关联角色权限(VIEW-P102)
|
||||
('VP-0011', 'VIEW-P102', 'perm_role_view', 'system', NULL, now(), false),
|
||||
('VP-0012', 'VIEW-P102', 'perm_role_create', 'system', NULL, now(), false),
|
||||
('VP-0013', 'VIEW-P102', 'perm_role_edit', 'system', NULL, now(), false),
|
||||
('VP-0014', 'VIEW-P102', 'perm_role_delete', 'system', NULL, now(), false),
|
||||
('VP-0015', 'VIEW-P102', 'perm_role_export', 'system', NULL, now(), false),
|
||||
|
||||
-- 权限管理视图关联权限管理权限
|
||||
('VP-0031', 'view_permission', 'perm_permission_view', 'system', NULL, now(), false),
|
||||
('VP-0032', 'view_permission', 'perm_permission_manage', 'system', NULL, now(), false),
|
||||
-- 部门管理视图关联部门权限(VIEW-P103)
|
||||
('VP-0021', 'VIEW-P103', 'perm_dept_view', 'system', NULL, now(), false),
|
||||
('VP-0022', 'VIEW-P103', 'perm_dept_create', 'system', NULL, now(), false),
|
||||
('VP-0023', 'VIEW-P103', 'perm_dept_edit', 'system', NULL, now(), false),
|
||||
('VP-0024', 'VIEW-P103', 'perm_dept_delete', 'system', NULL, now(), false),
|
||||
('VP-0025', 'VIEW-P103', 'perm_dept_export', 'system', NULL, now(), false),
|
||||
|
||||
-- 配置管理视图关联配置权限
|
||||
('VP-0041', 'view_config', 'perm_config_view', 'system', NULL, now(), false),
|
||||
('VP-0042', 'view_config', 'perm_config_edit', 'system', NULL, now(), false),
|
||||
('VP-0043', 'view_config', 'perm_config_export', 'system', NULL, now(), false),
|
||||
-- 权限管理视图关联权限管理权限(VIEW-P104)
|
||||
('VP-0031', 'VIEW-P104', 'perm_permission_view', 'system', NULL, now(), false),
|
||||
('VP-0032', 'VIEW-P104', 'perm_permission_manage', 'system', NULL, now(), false),
|
||||
|
||||
-- 文件管理视图关联文件权限
|
||||
('VP-0051', 'view_file', 'perm_file_view', 'system', NULL, now(), false),
|
||||
('VP-0052', 'view_file', 'perm_file_upload', 'system', NULL, now(), false),
|
||||
('VP-0053', 'view_file', 'perm_file_download', 'system', NULL, now(), false),
|
||||
('VP-0054', 'view_file', 'perm_file_delete', 'system', NULL, now(), false),
|
||||
('VP-0055', 'view_file', 'perm_file_export', 'system', NULL, now(), false),
|
||||
-- 配置管理视图关联配置权限(VIEW-P105)
|
||||
('VP-0041', 'VIEW-P105', 'perm_config_view', 'system', NULL, now(), false),
|
||||
('VP-0042', 'VIEW-P105', 'perm_config_edit', 'system', NULL, now(), false),
|
||||
('VP-0043', 'VIEW-P105', 'perm_config_export', 'system', NULL, now(), false),
|
||||
|
||||
-- 消息管理视图关联消息权限
|
||||
('VP-0061', 'view_message', 'perm_message_view', 'system', NULL, now(), false),
|
||||
('VP-0062', 'view_message', 'perm_message_send', 'system', NULL, now(), false),
|
||||
('VP-0063', 'view_message', 'perm_message_manage', 'system', NULL, now(), false),
|
||||
('VP-0064', 'view_message', 'perm_message_export', 'system', NULL, now(), false);
|
||||
-- 文件管理视图关联文件权限(VIEW-P106)
|
||||
('VP-0051', 'VIEW-P106', 'perm_file_view', 'system', NULL, now(), false),
|
||||
('VP-0052', 'VIEW-P106', 'perm_file_upload', 'system', NULL, now(), false),
|
||||
('VP-0053', 'VIEW-P106', 'perm_file_download', 'system', NULL, now(), false),
|
||||
('VP-0054', 'VIEW-P106', 'perm_file_delete', 'system', NULL, now(), false),
|
||||
('VP-0055', 'VIEW-P106', 'perm_file_export', 'system', NULL, now(), false),
|
||||
|
||||
-- 消息管理视图关联消息权限(VIEW-P107)
|
||||
('VP-0061', 'VIEW-P107', 'perm_message_view', 'system', NULL, now(), false),
|
||||
('VP-0062', 'VIEW-P107', 'perm_message_send', 'system', NULL, now(), false),
|
||||
('VP-0063', 'VIEW-P107', 'perm_message_manage', 'system', NULL, now(), false),
|
||||
('VP-0064', 'VIEW-P107', 'perm_message_export', 'system', NULL, now(), false);
|
||||
|
||||
@@ -12,7 +12,7 @@ urban-lifeline:
|
||||
- /** # 认证服务的所有接口都放行
|
||||
security:
|
||||
aes:
|
||||
secret-key: 1234567890qwer
|
||||
secret-key: MTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0NTY3ODkwMTI= # Base64 编码,32字节(256位)
|
||||
# ================== Spring ==================
|
||||
spring:
|
||||
application:
|
||||
|
||||
@@ -36,9 +36,18 @@ public class TbSysViewDTO extends BaseDTO {
|
||||
@Schema(description = "图标")
|
||||
private String icon;
|
||||
|
||||
@Schema(description = "类型")
|
||||
@Schema(description = "类型:0=目录 1=菜单页面 2=按钮")
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "页面类型:route=路由页面 iframe=嵌入页面")
|
||||
private String viewType;
|
||||
|
||||
@Schema(description = "iframe URL(仅当viewType=iframe时有效)")
|
||||
private String iframeUrl;
|
||||
|
||||
@Schema(description = "所属服务:platform=平台应用 bidding=招标应用 workcase=客服应用")
|
||||
private String service;
|
||||
|
||||
@Schema(description = "布局")
|
||||
private String layout;
|
||||
|
||||
|
||||
@@ -37,9 +37,9 @@ spring:
|
||||
- id: auth-service
|
||||
uri: lb://auth-service
|
||||
predicates:
|
||||
- Path=/auth/**
|
||||
- Path=/urban-lifeline/auth/**
|
||||
filters:
|
||||
- RewritePath=/auth/(?<segment>.*), /urban-lifeline/auth/$\{segment}
|
||||
# 不需要重写,直接转发保持原路径
|
||||
- name: RequestRateLimiter
|
||||
args:
|
||||
redis-rate-limiter.replenishRate: 100
|
||||
@@ -49,73 +49,55 @@ spring:
|
||||
- id: system-service
|
||||
uri: lb://system-service
|
||||
predicates:
|
||||
- Path=/system/**
|
||||
filters:
|
||||
- RewritePath=/system/(?<segment>.*), /urban-lifeline/system/$\{segment}
|
||||
- Path=/urban-lifeline/system/**
|
||||
|
||||
# ==================== 日志服务路由 ====================
|
||||
- id: log-service
|
||||
uri: lb://log-service
|
||||
predicates:
|
||||
- Path=/log/**
|
||||
filters:
|
||||
- RewritePath=/log/(?<segment>.*), /urban-lifeline/log/$\{segment}
|
||||
- Path=/urban-lifeline/log/**
|
||||
|
||||
# ==================== 文件服务路由 ====================
|
||||
- id: file-service
|
||||
uri: lb://file-service
|
||||
predicates:
|
||||
- Path=/file/**
|
||||
filters:
|
||||
- RewritePath=/file/(?<segment>.*), /urban-lifeline/file/$\{segment}
|
||||
- Path=/urban-lifeline/file/**
|
||||
|
||||
# ==================== 消息服务路由 ====================
|
||||
- id: message-service
|
||||
uri: lb://message-service
|
||||
predicates:
|
||||
- Path=/message/**
|
||||
filters:
|
||||
- RewritePath=/message/(?<segment>.*), /urban-lifeline/message/$\{segment}
|
||||
- Path=/urban-lifeline/message/**
|
||||
|
||||
# ==================== 招投标服务路由 ====================
|
||||
- id: bidding-service
|
||||
uri: lb://bidding-service
|
||||
predicates:
|
||||
- Path=/bidding/**
|
||||
filters:
|
||||
- RewritePath=/bidding/(?<segment>.*), /urban-lifeline/bidding/$\{segment}
|
||||
- Path=/urban-lifeline/bidding/**
|
||||
|
||||
# ==================== 平台服务路由 ====================
|
||||
- id: platform-service
|
||||
uri: lb://platform-service
|
||||
predicates:
|
||||
- Path=/platform/**
|
||||
filters:
|
||||
- RewritePath=/platform/(?<segment>.*), /urban-lifeline/platform/$\{segment}
|
||||
- Path=/urban-lifeline/platform/**
|
||||
|
||||
# ==================== 工单服务路由 ====================
|
||||
- id: workcase-service
|
||||
uri: lb://workcase-service
|
||||
predicates:
|
||||
- Path=/workcase/**
|
||||
filters:
|
||||
- RewritePath=/workcase/(?<segment>.*), /urban-lifeline/workcase/$\{segment}
|
||||
- Path=/urban-lifeline/workcase/**
|
||||
|
||||
# ==================== 定时任务服务路由 ====================
|
||||
- id: crontab-service
|
||||
uri: lb://crontab-service
|
||||
predicates:
|
||||
- Path=/crontab/**
|
||||
filters:
|
||||
- RewritePath=/crontab/(?<segment>.*), /urban-lifeline/crontab/$\{segment}
|
||||
- Path=/urban-lifeline/crontab/**
|
||||
|
||||
# ==================== AI Agent 服务路由 ====================
|
||||
- id: agent-service
|
||||
uri: lb://agent-service
|
||||
predicates:
|
||||
- Path=/agent/**
|
||||
filters:
|
||||
- RewritePath=/agent/(?<segment>.*), /urban-lifeline/agent/$\{segment}
|
||||
- Path=/urban-lifeline/agent/**
|
||||
|
||||
# 全局跨域配置
|
||||
globalcors:
|
||||
@@ -175,7 +157,7 @@ auth:
|
||||
- /error
|
||||
security:
|
||||
aes:
|
||||
secret-key: 1234567890qwer
|
||||
secret-key: MTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0NTY3ODkwMTI= # Base64 编码,32字节(256位)
|
||||
# Actuator 监控端点
|
||||
management:
|
||||
endpoints:
|
||||
|
||||
@@ -12,6 +12,9 @@
|
||||
<result column="component" property="component" jdbcType="VARCHAR"/>
|
||||
<result column="icon" property="icon" jdbcType="VARCHAR"/>
|
||||
<result column="type" property="type" jdbcType="INTEGER"/>
|
||||
<result column="view_type" property="viewType" jdbcType="VARCHAR"/>
|
||||
<result column="iframe_url" property="iframeUrl" jdbcType="VARCHAR"/>
|
||||
<result column="service" property="service" jdbcType="VARCHAR"/>
|
||||
<result column="layout" property="layout" jdbcType="VARCHAR"/>
|
||||
<result column="order_num" property="orderNum" jdbcType="INTEGER"/>
|
||||
<result column="description" property="description" jdbcType="VARCHAR"/>
|
||||
@@ -29,7 +32,7 @@
|
||||
|
||||
<!-- 基础列 -->
|
||||
<sql id="Base_Column_List">
|
||||
view_id, name, parent_id, url, component, icon, type, layout, order_num, description,
|
||||
view_id, name, parent_id, url, component, icon, type, view_type, iframe_url, service, layout, order_num, description,
|
||||
optsn, creator, updater, dept_path, remark, create_time, update_time, delete_time, deleted
|
||||
</sql>
|
||||
|
||||
@@ -44,11 +47,14 @@
|
||||
layout,
|
||||
order_num,
|
||||
optsn,
|
||||
<!-- 可选字段:parent_id, url, component, icon, description 及基础字段 -->
|
||||
<!-- 可选字段:parent_id, url, component, icon, view_type, iframe_url, service, description 及基础字段 -->
|
||||
<if test="parentId != null and parentId != ''">parent_id,</if>
|
||||
<if test="url != null and url != ''">url,</if>
|
||||
<if test="component != null and component != ''">component,</if>
|
||||
<if test="icon != null and icon != ''">icon,</if>
|
||||
<if test="viewType != null and viewType != ''">view_type,</if>
|
||||
<if test="iframeUrl != null and iframeUrl != ''">iframe_url,</if>
|
||||
<if test="service != null and service != ''">service,</if>
|
||||
<if test="description != null and description != ''">description,</if>
|
||||
<if test="creator != null and creator != ''">creator,</if>
|
||||
<if test="deptPath != null and deptPath != ''">dept_path,</if>
|
||||
@@ -72,6 +78,9 @@
|
||||
<if test="url != null and url != ''">#{url},</if>
|
||||
<if test="component != null and component != ''">#{component},</if>
|
||||
<if test="icon != null and icon != ''">#{icon},</if>
|
||||
<if test="viewType != null and viewType != ''">#{viewType},</if>
|
||||
<if test="iframeUrl != null and iframeUrl != ''">#{iframeUrl},</if>
|
||||
<if test="service != null and service != ''">#{service},</if>
|
||||
<if test="description != null and description != ''">#{description},</if>
|
||||
<if test="creator != null and creator != ''">#{creator},</if>
|
||||
<if test="deptPath != null and deptPath != ''">#{deptPath},</if>
|
||||
@@ -105,6 +114,15 @@
|
||||
<if test="type != null">
|
||||
type = #{type},
|
||||
</if>
|
||||
<if test="viewType != null">
|
||||
view_type = #{viewType},
|
||||
</if>
|
||||
<if test="iframeUrl != null">
|
||||
iframe_url = #{iframeUrl},
|
||||
</if>
|
||||
<if test="service != null">
|
||||
service = #{service},
|
||||
</if>
|
||||
<if test="layout != null">
|
||||
layout = #{layout},
|
||||
</if>
|
||||
@@ -168,6 +186,12 @@
|
||||
<if test="filter.type != null">
|
||||
AND type = #{filter.type}
|
||||
</if>
|
||||
<if test="filter.viewType != null and filter.viewType != ''">
|
||||
AND view_type = #{filter.viewType}
|
||||
</if>
|
||||
<if test="filter.service != null and filter.service != ''">
|
||||
AND service = #{filter.service}
|
||||
</if>
|
||||
<if test="filter.deptPath != null and filter.deptPath != ''">
|
||||
AND dept_path LIKE CONCAT(#{filter.deptPath}, '%')
|
||||
</if>
|
||||
@@ -194,6 +218,12 @@
|
||||
<if test="filter.type != null">
|
||||
AND type = #{filter.type}
|
||||
</if>
|
||||
<if test="filter.viewType != null and filter.viewType != ''">
|
||||
AND view_type = #{filter.viewType}
|
||||
</if>
|
||||
<if test="filter.service != null and filter.service != ''">
|
||||
AND service = #{filter.service}
|
||||
</if>
|
||||
<if test="filter.deptPath != null and filter.deptPath != ''">
|
||||
AND dept_path LIKE CONCAT(#{filter.deptPath}, '%')
|
||||
</if>
|
||||
@@ -220,6 +250,12 @@
|
||||
<if test="filter.type != null">
|
||||
AND type = #{filter.type}
|
||||
</if>
|
||||
<if test="filter.viewType != null and filter.viewType != ''">
|
||||
AND view_type = #{filter.viewType}
|
||||
</if>
|
||||
<if test="filter.service != null and filter.service != ''">
|
||||
AND service = #{filter.service}
|
||||
</if>
|
||||
<if test="filter.deptPath != null and filter.deptPath != ''">
|
||||
AND dept_path LIKE CONCAT(#{filter.deptPath}, '%')
|
||||
</if>
|
||||
|
||||
Reference in New Issue
Block a user