refactor: 使用更简洁的方式进行认证
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { ResourcePurpose } from "@/APIClient";
|
||||
import { ResourceClient, ResourcePurpose } from "@/APIClient";
|
||||
import { AuthManager } from "@/utils/AuthManager";
|
||||
|
||||
// 定义 diagram.json 的类型结构
|
||||
@@ -94,7 +94,7 @@ export async function loadDiagramData(examId?: string): Promise<DiagramData> {
|
||||
// 如果提供了examId,优先从API加载实验的diagram
|
||||
if (examId) {
|
||||
try {
|
||||
const resourceClient = AuthManager.createAuthenticatedResourceClient();
|
||||
const resourceClient = AuthManager.createClient(ResourceClient);
|
||||
|
||||
// 获取diagram类型的资源列表
|
||||
const resources = await resourceClient.getResourceList(
|
||||
|
||||
Reference in New Issue
Block a user