更新環境變數設定以支援生產模式的API端點 | 新增空的GLSL著色器檔案

This commit is contained in:
koko 2025-09-03 14:48:20 +08:00
parent e22732775a
commit cea34c2e9d
4 changed files with 7 additions and 1 deletions

View File

@ -1,3 +1,4 @@
VITE_API_BASEURL = "http://192.168.1.10:8010" VITE_API_BASEURL = "http://192.168.1.10:8010"
VITE_API_PORT = "8010"
VITE_FILE_API_BASEURL = ".." VITE_FILE_API_BASEURL = ".."
VITE_FORGE_BASEURL = "http://202.39.218.221:8080/file/netzero" VITE_FORGE_BASEURL = "http://202.39.218.221:8080/file/netzero"

View File

@ -1,6 +1,11 @@
import useGetCookie from "@/hooks/useGetCookie"; import useGetCookie from "@/hooks/useGetCookie";
import axios from "axios"; import axios from "axios";
const BASEURL = import.meta.env.VITE_API_BASEURL; const BASEURL =
import.meta.env.MODE === "production"
? `${window.location.protocol}//${window.location.hostname}:${
import.meta.env.VITE_API_PORT
}`
: import.meta.env.VITE_API_BASEURL;
const instance = axios.create({ const instance = axios.create({
baseURL: BASEURL, baseURL: BASEURL,