使用环境变量
This commit is contained in:
6
.env.production
Normal file
6
.env.production
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
PUBLIC_JUDGE0API_URL=https://judge0api.xuyue.cc
|
||||||
|
PUBLIC_MAXKB_URL=https://maxkb.xuyue.cc
|
||||||
|
PUBLIC_MAXKB_TOKEN=1b7cd529423b3f36
|
||||||
|
PUBLIC_CODEAPI_URL=https://codeapi.xuyue.cc
|
||||||
|
PUBLIC_PYVIZ_URL=https://pyviz.xuyue.cc
|
||||||
|
PUBLIC_PROTOCOL=https
|
||||||
6
.env.staging
Normal file
6
.env.staging
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
PUBLIC_JUDGE0API_URL=http://10.13.114.214:8082
|
||||||
|
PUBLIC_MAXKB_URL=http://10.13.114.214:8089
|
||||||
|
PUBLIC_MAXKB_TOKEN=1b7cd529423b3f36
|
||||||
|
PUBLIC_CODEAPI_URL=http://10.13.114.214:8092
|
||||||
|
PUBLIC_PYVIZ_URL=http://10.13.114.214:9000
|
||||||
|
PUBLIC_PROTOCOL=http
|
||||||
@@ -12,7 +12,7 @@
|
|||||||
<script
|
<script
|
||||||
async
|
async
|
||||||
defer
|
defer
|
||||||
src="https://maxkb.xuyue.cc/api/application/embed?protocol=https&host=maxkb.xuyue.cc&token=1b7cd529423b3f36"
|
src="<%= process.env.PUBLIC_MAXKB_URL %>/api/application/embed?protocol=<%= process.env.PUBLIC_PROTOCOL %>&<%= process.env.PUBLIC_MAXKB_URL %>&token=<%= process.env.PUBLIC_MAXKB_TOKEN %>"
|
||||||
></script>
|
></script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|||||||
946
package-lock.json
generated
946
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
17
package.json
17
package.json
@@ -1,18 +1,19 @@
|
|||||||
{
|
{
|
||||||
"name": "code-next",
|
"name": "code-next",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "1.1.0",
|
"version": "1.2.0",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "rsbuild dev",
|
"start": "rsbuild dev",
|
||||||
"build": "rsbuild build",
|
"build": "rsbuild build",
|
||||||
|
"build:staging": "rsbuild build --env-mode=staging",
|
||||||
"fmt": "prettier --write src"
|
"fmt": "prettier --write src"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@codemirror/lang-cpp": "^6.0.2",
|
"@codemirror/lang-cpp": "^6.0.2",
|
||||||
"@codemirror/lang-python": "^6.1.7",
|
"@codemirror/lang-python": "^6.2.0",
|
||||||
"@vueuse/core": "^13.0.0",
|
"@vueuse/core": "^13.1.0",
|
||||||
"axios": "^1.8.4",
|
"axios": "^1.9.0",
|
||||||
"client-zip": "1.7.0",
|
"client-zip": "1.7.0",
|
||||||
"codemirror": "^6.0.1",
|
"codemirror": "^6.0.1",
|
||||||
"copy-text-to-clipboard": "^3.2.0",
|
"copy-text-to-clipboard": "^3.2.0",
|
||||||
@@ -20,19 +21,19 @@
|
|||||||
"file-saver": "^2.0.5",
|
"file-saver": "^2.0.5",
|
||||||
"naive-ui": "^2.41.0",
|
"naive-ui": "^2.41.0",
|
||||||
"normalize.css": "^8.0.1",
|
"normalize.css": "^8.0.1",
|
||||||
"query-string": "^9.1.1",
|
"query-string": "^9.1.2",
|
||||||
"vue": "^3.5.13",
|
"vue": "^3.5.13",
|
||||||
"vue-codemirror": "^6.1.1"
|
"vue-codemirror": "^6.1.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@iconify/vue": "^4.3.0",
|
"@iconify/vue": "^5.0.0",
|
||||||
"@rsbuild/core": "^1.2.19",
|
"@rsbuild/core": "^1.3.17",
|
||||||
"@rsbuild/plugin-vue": "^1.0.7",
|
"@rsbuild/plugin-vue": "^1.0.7",
|
||||||
"@types/file-saver": "^2.0.7",
|
"@types/file-saver": "^2.0.7",
|
||||||
"@vitejs/plugin-vue": "^5.2.3",
|
"@vitejs/plugin-vue": "^5.2.3",
|
||||||
"prettier": "^3.5.3",
|
"prettier": "^3.5.3",
|
||||||
"prettier-plugin-organize-imports": "^4.1.0",
|
"prettier-plugin-organize-imports": "^4.1.0",
|
||||||
"typescript": "^5.8.2",
|
"typescript": "^5.8.3",
|
||||||
"vite": "^6.2.2"
|
"vite": "^6.2.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,8 +24,8 @@ function decode(bytes?: string) {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
const judge = axios.create({ baseURL: `https://judge0api.xuyue.cc` })
|
const judge = axios.create({ baseURL: import.meta.env.PUBLIC_JUDGE0API_URL })
|
||||||
const api = axios.create({ baseURL: `https://codeapi.xuyue.cc` })
|
const api = axios.create({ baseURL: import.meta.env.PUBLIC_CODEAPI_URL })
|
||||||
|
|
||||||
export async function submit(code: Code, input: string) {
|
export async function submit(code: Code, input: string) {
|
||||||
const encodedCode = encode(code.value)
|
const encodedCode = encode(code.value)
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ const isDark = useDark()
|
|||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
// const url = "http://localhost:8000"
|
// 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 base = url + "/iframe-embed.html"
|
||||||
|
|
||||||
const part1 = qs.stringify({
|
const part1 = qs.stringify({
|
||||||
|
|||||||
Reference in New Issue
Block a user