You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
63 lines
1.5 KiB
63 lines
1.5 KiB
import { useState } from '#imports';
|
|
import type { Config } from '~/types/global';
|
|
import type {Website} from "~/api/cms/website/model";
|
|
import type {Navigation} from "~/api/cms/navigation/model";
|
|
import type {User} from "~/api/system/user/model";
|
|
|
|
// 网站信息
|
|
export const useWebsite = () =>
|
|
useState<Website>('website', () => {
|
|
return {};
|
|
});
|
|
|
|
// 参数配置
|
|
export const useConfigInfo = () =>
|
|
useState<Config>('config', () => {
|
|
return {};
|
|
});
|
|
|
|
// 主导航
|
|
export const useMenu = () =>
|
|
useState<Navigation[]>('menu', () => {
|
|
return [];
|
|
});
|
|
|
|
// 副导航
|
|
export const useSubMenu = () =>
|
|
useState<Navigation[]>('subMenu', () => {
|
|
return [];
|
|
});
|
|
|
|
// 页面元素
|
|
export const useForm = () => useState<Navigation>('form', () => {
|
|
return {};
|
|
});
|
|
|
|
// 固钉
|
|
export const useProductAffix = () =>
|
|
useState<boolean>('affixTop', () => {
|
|
return false;
|
|
});
|
|
// 后台管理域名
|
|
export const useSysDomain = () => useState('useSysDomain', () => '');
|
|
|
|
// 登录凭证
|
|
export const useToken = () => useState('token', () => '');
|
|
|
|
// 用户信息
|
|
export const useUser = () =>
|
|
useState<User>('user', () => {
|
|
return {
|
|
userId: 0,
|
|
avatar: '',
|
|
phone: '',
|
|
nickname: '',
|
|
gradeId: 0,
|
|
gradeName: '',
|
|
tenantId: 0,
|
|
tenantName: '',
|
|
};
|
|
});
|
|
|
|
// 是否显示登录弹窗
|
|
export const useShowLogin = () => useState('showLogin',() => false)
|