fix: 脚本内容接口改为 POST 彻底解决参数传递问题

This commit is contained in:
2026-06-25 17:43:18 +08:00
parent 473568e0c4
commit c31228d174
2 changed files with 16 additions and 25 deletions
+2 -2
View File
@@ -49,7 +49,7 @@ import * as monaco from 'monaco-editor/esm/vs/editor/editor.api.js';
import editorWorker from 'monaco-editor/esm/vs/editor/editor.worker?worker';
import 'monaco-editor/esm/vs/basic-languages/sql/sql.contribution';
import { apiGet, apiPost } from '../api/client';
import { apiPost } from '../api/client';
import type { ApiMessage, ScriptContent, TaskStatus } from '../types';
import { toColoredLogLines } from '../composables/logLines';
import { resetPageHeader, setPageHeader } from '../composables/pageHeader';
@@ -236,7 +236,7 @@ async function loadScript(type?: string) {
const target = type || scriptType.value;
loading.value = true;
try {
const result = await apiGet<ScriptContent & { script_type?: string }>(`/api/script/content?script_type=${target}`);
const result = await apiPost<ScriptContent>('/api/script/content', { script_type: target });
if (!result.success) {
throw new Error(result.error || '加载脚本失败');
}