框架更新

This commit is contained in:
2024-08-02 23:22:38 +08:00
parent 0cda1968e8
commit ff46808425
214 changed files with 6171 additions and 15881 deletions
+40
View File
@@ -0,0 +1,40 @@
/**
* 小程序信息 store
*/
import {defineStore} from 'pinia';
import {getMpInfo} from '@/api/layout';
import type {MpInfo} from "@/api/cms/mp/model";
export interface UserState {
mpInfo: MpInfo | null;
}
export const useMpStore = defineStore({
id: 'mp',
state: (): UserState => ({
// 小程序
mpInfo: null,
}),
getters: {},
actions: {
/**
* 请求用户信息、权限、角色、菜单
*/
async fetchMpInfo() {
const info = await getMpInfo().catch(() => void 0);
if (!info) {
return {};
}
// 租户信息
this.mpInfo = info;
return info;
},
/**
* 更新租户信息
*/
setInfo(value: MpInfo) {
this.mpInfo = value;
}
}
});