更新密码找回uniapp
This commit is contained in:
1 parent
7f9a66da0f
commit
3fdda89833
1304 files changed
+3503
-26132
No files matched your search
@@ -1,23 +1,3 @@
|
||||
-- ============================================================
|
||||
-- OA AI 办公 —— 菜单配置(yz_system_menu)
|
||||
-- 幂等脚本:按 path 判重,重复执行不会产生重复菜单
|
||||
-- 执行:mysql -h <host> -P <port> -u <user> -p <db> < oa_ai_menus.sql
|
||||
--
|
||||
-- 挂载位置:
|
||||
-- OA → 办公 → AI办公(页面,/apps/oa/ai)
|
||||
-- OA → 基础设置 → AI设置(页面,/basic-settings/ai)
|
||||
--
|
||||
-- 对应页面:
|
||||
-- backend/src/views/apps/oa/ai/index.vue AI 广场(场景对话)
|
||||
-- backend/src/views/basicSettings/ai/index.vue AI 设置(租户级接口 + Key)
|
||||
--
|
||||
-- 说明:
|
||||
-- 1. AI 接入配置是租户级的(yz_backend_ai_provider.user_id = 0),
|
||||
-- 由「AI设置」页统一维护,保存后全租户共用;
|
||||
-- 2. 「AI办公」是 Web 页面(platforms=["web"]),移动端暂不提供;
|
||||
-- 3. 租户端角色(cid=2)的 rights 是显式菜单 ID 列表,只插菜单不授权
|
||||
-- 会被过滤掉,因此本脚本把菜单 ID 追加到角色 rights。
|
||||
-- ============================================================
|
||||
|
||||
SET @oa_id := (
|
||||
SELECT id FROM yz_system_menu
|
||||
@@ -25,7 +5,6 @@ SET @oa_id := (
|
||||
LIMIT 1
|
||||
);
|
||||
|
||||
-- 「办公」目录:优先同名菜单,其次 /apps/oa/personal;都没有则回落 OA 根
|
||||
SET @office_id := (
|
||||
SELECT id FROM yz_system_menu
|
||||
WHERE delete_time IS NULL
|
||||
@@ -35,7 +14,6 @@ SET @office_id := (
|
||||
LIMIT 1
|
||||
);
|
||||
|
||||
-- OA 基础设置目录(AI 设置挂这里)
|
||||
SET @basic_id := (
|
||||
SELECT id FROM yz_system_menu
|
||||
WHERE path = '/apps/oa/normalsetting' AND delete_time IS NULL
|
||||
@@ -45,7 +23,6 @@ SET @basic_id := (
|
||||
SET @office_parent := IFNULL(@office_id, @oa_id);
|
||||
SET @basic_parent := IFNULL(@basic_id, @office_parent);
|
||||
|
||||
-- ---------- AI办公(页面,挂在办公下) ----------
|
||||
INSERT INTO yz_system_menu
|
||||
(pid, title, path, component_path, icon, sort, status, is_visible, views, platforms, type, creater, remark)
|
||||
SELECT @office_parent, 'AI办公', '/apps/oa/ai', '/apps/oa/ai/index.vue',
|
||||
@@ -68,7 +45,6 @@ SET pid = IFNULL(@office_parent, pid),
|
||||
is_visible = 1
|
||||
WHERE path = '/apps/oa/ai' AND delete_time IS NULL;
|
||||
|
||||
-- ---------- AI设置(页面,挂在 OA 基础设置下) ----------
|
||||
INSERT INTO yz_system_menu
|
||||
(pid, title, path, component_path, icon, sort, status, is_visible, views, platforms, type, creater, remark)
|
||||
SELECT @basic_parent, 'AI设置', '/basic-settings/ai', '/basicSettings/ai/index.vue',
|
||||
@@ -91,8 +67,6 @@ SET pid = IFNULL(@basic_parent, pid),
|
||||
is_visible = 1
|
||||
WHERE path = '/basic-settings/ai' AND delete_time IS NULL;
|
||||
|
||||
-- ---------- 角色授权:把菜单追加到所有租户端角色的 rights ----------
|
||||
-- 只处理 rights 非空(显式授权)的角色;rights 为空表示全权限,无需追加。
|
||||
UPDATE yz_system_admin_role
|
||||
SET rights = CAST(JSON_ARRAY_APPEND(CAST(rights AS JSON), '$', @ai_page_id) AS CHAR)
|
||||
WHERE cid = 2
|
||||
@@ -107,7 +81,6 @@ WHERE cid = 2
|
||||
AND @ai_settings_id IS NOT NULL
|
||||
AND NOT JSON_CONTAINS(CAST(rights AS JSON), CAST(@ai_settings_id AS JSON));
|
||||
|
||||
-- ---------- 结果校验 ----------
|
||||
SELECT id, pid, title, path, component_path, platforms, type, sort, is_visible
|
||||
FROM yz_system_menu
|
||||
WHERE delete_time IS NULL
|
||||
|
||||
Reference in new issue
Block a user