feat: 统一资源管理
This commit is contained in:
@@ -37,7 +37,7 @@
|
||||
<!-- 拖拽分割线 -->
|
||||
<SplitterResizeHandle
|
||||
id="splitter-group-h-resize-handle"
|
||||
class="w-2 bg-base-100 hover:bg-primary hover:opacity-70 transition-colors"
|
||||
class="w-1 bg-base-300"
|
||||
/>
|
||||
<!-- 右侧编辑区域 -->
|
||||
<SplitterPanel
|
||||
@@ -74,7 +74,7 @@
|
||||
<SplitterResizeHandle
|
||||
v-show="!isBottomBarFullscreen"
|
||||
id="splitter-group-v-resize-handle"
|
||||
class="h-2 bg-base-100 hover:bg-primary hover:opacity-70 transition-colors"
|
||||
class="h-1 bg-base-300"
|
||||
/>
|
||||
|
||||
<!-- 功能底栏 -->
|
||||
@@ -217,17 +217,17 @@ async function loadDocumentContent() {
|
||||
if (examId) {
|
||||
// 如果有实验ID,从API加载实验文档
|
||||
console.log('加载实验文档:', examId);
|
||||
const client = AuthManager.createAuthenticatedExamClient();
|
||||
const client = AuthManager.createAuthenticatedResourceClient();
|
||||
|
||||
// 获取markdown类型的资源列表
|
||||
const resources = await client.getExamResourceList(examId, 'doc');
|
||||
// 获取markdown类型的模板资源列表
|
||||
const resources = await client.getResourceList(examId, 'doc', 'template');
|
||||
|
||||
if (resources && resources.length > 0) {
|
||||
// 获取第一个markdown资源
|
||||
const markdownResource = resources[0];
|
||||
|
||||
// 使用动态API获取资源文件内容
|
||||
const response = await client.getExamResourceById(markdownResource.id);
|
||||
// 使用新的ResourceClient API获取资源文件内容
|
||||
const response = await client.getResourceById(markdownResource.id);
|
||||
|
||||
if (!response || !response.data) {
|
||||
throw new Error('获取markdown文件失败');
|
||||
|
||||
Reference in New Issue
Block a user