chore: 首页数据统计项目显示

This commit is contained in:
xiaojunnuo
2026-02-27 00:14:53 +08:00
parent 787f6ef528
commit b2c421600c
8 changed files with 72 additions and 22 deletions
+8 -6
View File
@@ -136,27 +136,29 @@ function createService() {
*/
function createRequestFunction(service: any) {
return function (config: any) {
const configDefault = {
const configDefault: any = {
headers: {
"Content-Type": get(config, "headers.Content-Type", "application/json"),
} as any,
timeout: 30000,
baseURL: env.API,
data: {},
params: {},
};
const projectStore = useProjectStore();
if (projectStore.isEnterprise && !config.url.startsWith("/sys") && !config.url.startsWith("http")) {
configDefault.headers["project-id"] = projectStore.currentProjectId;
}
const userStore = useUserStore();
const token = userStore.getToken;
if (token != null) {
// @ts-ignore
configDefault.headers.Authorization = token;
}
return service(Object.assign(configDefault, config));
Object.assign(configDefault, config);
if (projectStore.isEnterprise && !config.url.startsWith("/sys") && !config.url.startsWith("http")) {
configDefault.params.projectId = projectStore.currentProjectId;
}
return service(configDefault);
};
}