From 20612642e81a89155da38b45b62311ffc0adb9f2 Mon Sep 17 00:00:00 2001 From: Ryan Wang Date: Mon, 25 Jul 2022 10:41:24 +0800 Subject: [PATCH] chore: update the base url of the plugin resources Signed-off-by: Ryan Wang --- src/main.ts | 4 ++-- src/modules/interface/themes/Visual.vue | 2 +- src/modules/system/users/Login.vue | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main.ts b/src/main.ts index 26d3a436e..47597ed91 100644 --- a/src/main.ts +++ b/src/main.ts @@ -117,7 +117,7 @@ async function loadPluginModules() { if (entry) { const { load } = useScriptTag( - `http://localhost:8090${plugin.status?.entry}` + `${import.meta.env.VITE_API_URL}${plugin.status?.entry}` ); await load(); const pluginModule = window[plugin.metadata.name]; @@ -131,7 +131,7 @@ async function loadPluginModules() { if (stylesheet) { try { - await loadStyle(`http://localhost:8090${stylesheet}`); + await loadStyle(`${import.meta.env.VITE_API_URL}${stylesheet}`); } catch (e) { console.error(e); } diff --git a/src/modules/interface/themes/Visual.vue b/src/modules/interface/themes/Visual.vue index 4f2fa78c5..e02b6a260 100644 --- a/src/modules/interface/themes/Visual.vue +++ b/src/modules/interface/themes/Visual.vue @@ -151,7 +151,7 @@ onMounted(() => { diff --git a/src/modules/system/users/Login.vue b/src/modules/system/users/Login.vue index 23ee06e45..36e4d7e40 100644 --- a/src/modules/system/users/Login.vue +++ b/src/modules/system/users/Login.vue @@ -41,7 +41,7 @@ const handleLogin = async () => { try { loginForm.value.logging = true; - await fetch("http://localhost:8090/login", { + await fetch(`${import.meta.env.VITE_API_URL}/login`, { method: "POST", headers: { "Content-Type": "application/x-www-form-urlencoded",