From f68c1c95eb1ac388c252d6256929e84db6af9205 Mon Sep 17 00:00:00 2001 From: AoXuan Date: Mon, 4 Aug 2025 16:31:26 +0800 Subject: [PATCH] =?UTF-8?q?refactor(api):=20=E4=BF=AE=E6=94=B9api=E8=B0=83?= =?UTF-8?q?=E7=94=A8url?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/HelloWorld.vue | 41 - frontend/src/components/ScriptEditor.vue | 340 ------ frontend/src/composables/useScriptApi.ts | 8 +- frontend/src/views/ScriptEdit.vue | 1373 +++++++++++----------- frontend/src/views/Scripts.vue | 134 ++- 5 files changed, 744 insertions(+), 1152 deletions(-) delete mode 100644 frontend/src/components/HelloWorld.vue delete mode 100644 frontend/src/components/ScriptEditor.vue diff --git a/frontend/src/components/HelloWorld.vue b/frontend/src/components/HelloWorld.vue deleted file mode 100644 index b58e52b..0000000 --- a/frontend/src/components/HelloWorld.vue +++ /dev/null @@ -1,41 +0,0 @@ - - - - - diff --git a/frontend/src/components/ScriptEditor.vue b/frontend/src/components/ScriptEditor.vue deleted file mode 100644 index f1ba48a..0000000 --- a/frontend/src/components/ScriptEditor.vue +++ /dev/null @@ -1,340 +0,0 @@ - - - \ No newline at end of file diff --git a/frontend/src/composables/useScriptApi.ts b/frontend/src/composables/useScriptApi.ts index b7d998e..0c2205b 100644 --- a/frontend/src/composables/useScriptApi.ts +++ b/frontend/src/composables/useScriptApi.ts @@ -22,7 +22,7 @@ export function useScriptApi() { error.value = null try { - const response = await fetch(`${API_BASE_URL}/add/scripts`, { + const response = await fetch(`${API_BASE_URL}/scripts/add`, { method: 'POST', headers: { 'Content-Type': 'application/json', @@ -50,7 +50,7 @@ export function useScriptApi() { error.value = null try { - const response = await fetch(`${API_BASE_URL}/get/scripts`, { + const response = await fetch(`${API_BASE_URL}/scripts/get`, { method: 'POST', headers: { 'Content-Type': 'application/json', @@ -101,7 +101,7 @@ export function useScriptApi() { error.value = null try { - const response = await fetch(`${API_BASE_URL}/get/scripts`, { + const response = await fetch(`${API_BASE_URL}/scripts/get`, { method: 'POST', headers: { 'Content-Type': 'application/json', @@ -180,7 +180,7 @@ export function useScriptApi() { error.value = null try { - const response = await fetch(`${API_BASE_URL}/delete/scripts`, { + const response = await fetch(`${API_BASE_URL}/scripts/delete`, { method: 'POST', headers: { 'Content-Type': 'application/json', diff --git a/frontend/src/views/ScriptEdit.vue b/frontend/src/views/ScriptEdit.vue index 93fab8c..be1b01e 100644 --- a/frontend/src/views/ScriptEdit.vue +++ b/frontend/src/views/ScriptEdit.vue @@ -1,737 +1,712 @@