This commit is contained in:
Putoo
2026-05-19 15:10:59 +08:00
parent 2037d1e577
commit 24c784e6a4
14 changed files with 429 additions and 19 deletions

View File

@@ -11,7 +11,10 @@ export type HandledRedirectError = {
export class ApiService {
private static initialized = false;
private static get userStore() {
return useUserStore()
}
private static request = new RequestExtend({
baseURL: BaseConfig.BaseUrl,
timeout: 60000
@@ -43,7 +46,7 @@ export class ApiService {
RequestExtend.addRequestInterceptor({
onFulfilled: (config) => {
const token = typeof localStorage !== "undefined" ? localStorage.getItem("token") : "";
const token = this.userStore.token;
if (token) {
config.headers = {