feat(管理员): 入口文件新增获取的token的方法
This commit is contained in:
parent
cd5d6b2d56
commit
8a5fec01bf
@ -8,42 +8,50 @@ export const PageConfig = {
|
||||
needsBankBalance: true,
|
||||
needsWorkStatistics: true,
|
||||
needsRouteGuard: true,
|
||||
title: 'Host Center',
|
||||
userTag: '👑 Host'
|
||||
title: "Host Center",
|
||||
userTag: "👑 Host",
|
||||
},
|
||||
|
||||
COIN_SELLER: {
|
||||
needsBankBalance: true,
|
||||
needsWorkStatistics: false, // Coin Seller 不需要工作统计
|
||||
needsRouteGuard: true,
|
||||
title: 'Coin Seller',
|
||||
userTag: '💰 Coin Seller'
|
||||
title: "Coin Seller",
|
||||
userTag: "💰 Coin Seller",
|
||||
},
|
||||
|
||||
AGENCY_CENTER: {
|
||||
needsBankBalance: true,
|
||||
needsWorkStatistics: true,
|
||||
needsRouteGuard: true,
|
||||
title: 'Agency Center',
|
||||
userTag: '🏢 Agency'
|
||||
title: "Agency Center",
|
||||
userTag: "🏢 Agency",
|
||||
},
|
||||
|
||||
BD_CENTER: {
|
||||
needsBankBalance: true,
|
||||
needsWorkStatistics: false, // BD 可能不需要日常工作统计
|
||||
needsRouteGuard: true,
|
||||
title: 'BD Center',
|
||||
userTag: '📈 BD'
|
||||
title: "BD Center",
|
||||
userTag: "📈 BD",
|
||||
},
|
||||
|
||||
APPLY: {
|
||||
needsBankBalance: false, // 申请页面不需要余额
|
||||
needsBankBalance: false, // 申请页面不需要余额
|
||||
needsWorkStatistics: false, // 申请页面不需要工作统计
|
||||
needsRouteGuard: false, // 申请页面不需要身份检查
|
||||
title: 'Apply',
|
||||
userTag: null // 申请页面可能没有身份标签
|
||||
}
|
||||
}
|
||||
needsRouteGuard: false, // 申请页面不需要身份检查
|
||||
title: "Apply",
|
||||
userTag: null, // 申请页面可能没有身份标签
|
||||
},
|
||||
|
||||
ADMIN_CENTER: {
|
||||
needsBankBalance: true,
|
||||
needsWorkStatistics: false, // ADMIN 可能不需要日常工作统计
|
||||
needsRouteGuard: true,
|
||||
title: "ADMIN Center",
|
||||
userTag: "ADMIN",
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* 获取页面配置的工具函数
|
||||
@ -51,16 +59,16 @@ export const PageConfig = {
|
||||
* @returns {Object} 页面配置对象
|
||||
*/
|
||||
export function getPageConfig(pageType) {
|
||||
const config = PageConfig[pageType]
|
||||
const config = PageConfig[pageType];
|
||||
if (!config) {
|
||||
console.warn(`未找到页面配置: ${pageType}`)
|
||||
return PageConfig.HOST_CENTER // 默认使用 HOST_CENTER 配置
|
||||
console.warn(`未找到页面配置: ${pageType}`);
|
||||
return PageConfig.HOST_CENTER; // 默认使用 HOST_CENTER 配置
|
||||
}
|
||||
return config
|
||||
return config;
|
||||
}
|
||||
|
||||
// ==========================================
|
||||
import { usePageInitialization } from './usePageInitialization.js'
|
||||
import { usePageInitialization } from "./usePageInitialization.js";
|
||||
|
||||
/**
|
||||
* 使用预配置的页面初始化函数
|
||||
@ -69,14 +77,13 @@ import { usePageInitialization } from './usePageInitialization.js'
|
||||
* @returns {Object} usePageInitialization 的返回值
|
||||
*/
|
||||
export function usePageInitializationWithConfig(pageType, customOptions = {}) {
|
||||
const pageConfig = getPageConfig(pageType)
|
||||
const pageConfig = getPageConfig(pageType);
|
||||
|
||||
// 合并默认配置和自定义选项
|
||||
const options = {
|
||||
...pageConfig,
|
||||
...customOptions
|
||||
}
|
||||
...customOptions,
|
||||
};
|
||||
|
||||
return usePageInitialization(options)
|
||||
return usePageInitialization(options);
|
||||
}
|
||||
|
||||
|
||||
@ -164,6 +164,7 @@ import { getAdminCenterList, giveProps } from "@/api/itemDistribution";
|
||||
import { searchUser } from "@/api/userInfo";
|
||||
import { showError, showWarning, showInfo, showSuccess } from "@/utils/toast.js";
|
||||
import { useRouter } from "vue-router";
|
||||
import { usePageInitializationWithConfig } from "@/utils/pageConfig.js";
|
||||
|
||||
const router = useRouter();
|
||||
|
||||
@ -255,6 +256,9 @@ const rechargeDetail = ref({
|
||||
lastMonth: "12345",
|
||||
}); //代理消费金额
|
||||
|
||||
// 页面加载时获取申请记录
|
||||
usePageInitializationWithConfig("ADMIN_CENTER");
|
||||
|
||||
onMounted(() => {
|
||||
console.log("onMounted");
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user