chore: project controller

This commit is contained in:
xiaojunnuo
2026-02-11 00:07:29 +08:00
parent 784bcb0aa5
commit 1e416b9f8a
33 changed files with 773 additions and 53 deletions
+8 -1
View File
@@ -3,6 +3,7 @@ import { get } from "lodash-es";
import { errorLog, errorCreate } from "./tools";
import { env } from "/src/utils/util.env";
import { useUserStore } from "/@/store/user";
import { useProjectStore } from "../store/project";
export class CodeError extends Error {
code: number;
@@ -138,11 +139,17 @@ function createRequestFunction(service: any) {
const configDefault = {
headers: {
"Content-Type": get(config, "headers.Content-Type", "application/json"),
},
} as any,
timeout: 30000,
baseURL: env.API,
data: {},
};
const projectStore = useProjectStore();
if (projectStore.isEnterprise && !config.url.startsWith("/sys")) {
configDefault.headers["project-id"] = projectStore.currentProjectId;
}
const userStore = useUserStore();
const token = userStore.getToken;
if (token != null) {