使用环境变量

This commit is contained in:
2025-05-08 16:02:34 +08:00
parent eb9cda14ff
commit 33b6e242c3
7 changed files with 545 additions and 438 deletions

View File

@@ -24,8 +24,8 @@ function decode(bytes?: string) {
)
}
const judge = axios.create({ baseURL: `https://judge0api.xuyue.cc` })
const api = axios.create({ baseURL: `https://codeapi.xuyue.cc` })
const judge = axios.create({ baseURL: import.meta.env.PUBLIC_JUDGE0API_URL })
const api = axios.create({ baseURL: import.meta.env.PUBLIC_CODEAPI_URL })
export async function submit(code: Code, input: string) {
const encodedCode = encode(code.value)

View File

@@ -30,7 +30,7 @@ const isDark = useDark()
onMounted(() => {
// const url = "http://localhost:8000"
const url = "https://pyviz.xuyue.cc"
const url = import.meta.env.PUBLIC_PYVIZ_URL
const base = url + "/iframe-embed.html"
const part1 = qs.stringify({