feat: 统一资源管理

This commit is contained in:
alivender
2025-08-02 13:14:01 +08:00
parent e5f2be616c
commit 9904fecbee
15 changed files with 1178 additions and 838 deletions

View File

@@ -14,6 +14,7 @@ import {
OscilloscopeApiClient,
DebuggerClient,
ExamClient,
ResourceClient,
} from "@/APIClient";
import axios, { type AxiosInstance } from "axios";
@@ -33,7 +34,8 @@ type SupportedClient =
| NetConfigClient
| OscilloscopeApiClient
| DebuggerClient
| ExamClient;
| ExamClient
| ResourceClient;
export class AuthManager {
// 存储token到localStorage
@@ -196,6 +198,10 @@ export class AuthManager {
return AuthManager.createAuthenticatedClient(ExamClient);
}
public static createAuthenticatedResourceClient(): ResourceClient {
return AuthManager.createAuthenticatedClient(ResourceClient);
}
// 登录函数
public static async login(
username: string,