From 73515ab6a5418bef0c875d2dcdf022f521d24e05 Mon Sep 17 00:00:00 2001 From: hebo Date: Mon, 23 Feb 2026 17:31:01 +0800 Subject: [PATCH] =?UTF-8?q?SAAS=E6=A8=A1=E5=BC=8F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.vue | 3 + src/api/base/server.ts | 7 - src/api/system/config/index.ts | 16 ++ src/api/system/login/index.ts | 5 - src/api/system/menu.ts | 17 ++ src/pages/base/home/index.vue | 279 ++++++--------------- src/pages/system/launchPage/launchPage.vue | 87 ++++++- src/pages/system/login/login.vue | 121 ++++----- src/store/modules/data.ts | 10 + src/store/modules/menu.ts | 34 +++ src/store/modules/user.ts | 10 +- 11 files changed, 279 insertions(+), 310 deletions(-) create mode 100644 src/api/system/config/index.ts create mode 100644 src/api/system/menu.ts create mode 100644 src/store/modules/menu.ts diff --git a/src/App.vue b/src/App.vue index 8e3dc0a..f72d531 100644 --- a/src/App.vue +++ b/src/App.vue @@ -3,6 +3,9 @@ import {onHide, onLaunch, onShow} from "@dcloudio/uni-app"; onLaunch(() => { console.log("App Launch"); + // #ifdef H5 + document.title = "数字校园"; + // #endif }); onShow(() => { console.log("App Show"); diff --git a/src/api/base/server.ts b/src/api/base/server.ts index fc8d7fa..3632ea2 100644 --- a/src/api/base/server.ts +++ b/src/api/base/server.ts @@ -119,13 +119,6 @@ export const jzXsQjActivitiHistoryApi = async (params: any) => { return await get("/activiti/history/historicFlow", params); }; -/** - * 获取用户最新信息(包含学生信息) - */ -export const getUserLatestInfoApi = async () => { - return await get("/open/login/getLatestInfo"); -}; - /** * 根据课程ID查询作品执行数据(家长端) */ diff --git a/src/api/system/config/index.ts b/src/api/system/config/index.ts new file mode 100644 index 0000000..1345ed4 --- /dev/null +++ b/src/api/system/config/index.ts @@ -0,0 +1,16 @@ +import { get } from "@/utils/request"; + +/** 短时缓存,避免 launchPage 连续跳转时重复调用 */ +let _changeTimeCache: { promise: Promise; ts: number } | null = null; +const CACHE_MS = 10000; // 10 秒内复用 + +/** 获取权限变更时间戳,用于判断本地缓存的菜单是否需重新拉取 */ +export const getPermissionChangeTimeApi = () => { + const now = Date.now(); + if (_changeTimeCache && now - _changeTimeCache.ts < CACHE_MS) { + return _changeTimeCache.promise; + } + const promise = get("/api/comConfig/getPermissionChangeTime"); + _changeTimeCache = { promise, ts: now }; + return promise; +}; diff --git a/src/api/system/login/index.ts b/src/api/system/login/index.ts index c6e7164..f8bad11 100644 --- a/src/api/system/login/index.ts +++ b/src/api/system/login/index.ts @@ -44,11 +44,6 @@ export const weChatLogin = async (param: any) => { return await get("/userlogin/weloginByCode", param); }; -//获取用户按钮权限 -export const authenticationApi = async (param: { userId: string }) => { - return await get("/api/authentication/find-by-user", param); -}; - //获取公众号票据 export const wxConfigApi = async (param: any) => { return await post("/userlogin/wxConfig", param); diff --git a/src/api/system/menu.ts b/src/api/system/menu.ts new file mode 100644 index 0000000..49caba1 --- /dev/null +++ b/src/api/system/menu.ts @@ -0,0 +1,17 @@ +import { get } from "@/utils/request"; + +/** 手机端菜单树节点 */ +export interface MobileMenuTreeNode { + id: number; + parentId: number | null; + screenName: string; + normalCss?: string; + pagePath?: string; + sortNum: number; + authCode?: string; + children: MobileMenuTreeNode[]; +} + +/** 获取手机端菜单(家长端) */ +export const getMobileMenuApi = () => + get<{ result: MobileMenuTreeNode[] }>("/api/screen/find-mobile-menu"); diff --git a/src/pages/base/home/index.vue b/src/pages/base/home/index.vue index 3e02356..cf842de 100644 --- a/src/pages/base/home/index.vue +++ b/src/pages/base/home/index.vue @@ -24,7 +24,7 @@ - @@ -66,195 +66,76 @@