use rsbuild instead of vite
This commit is contained in:
@@ -255,4 +255,4 @@ export function deleteTutorial(id: number) {
|
||||
|
||||
export function setTutorialVisibility(id: number, is_public: boolean) {
|
||||
return http.put("admin/tutorial/visibility", { id, is_public })
|
||||
}
|
||||
}
|
||||
|
||||
@@ -99,7 +99,7 @@ const abnormalServers = computed(() =>
|
||||
)
|
||||
|
||||
const websiteConfig = reactive({
|
||||
website_base_url: import.meta.env.VITE_OJ_URL,
|
||||
website_base_url: import.meta.env.PUBLIC_OJ_URL,
|
||||
website_name: "判题狗",
|
||||
website_name_shortcut: "判题狗",
|
||||
website_footer: "所有权归属于徐越,感谢青岛大学开源 OJ 系统,感谢开源社区",
|
||||
|
||||
@@ -40,4 +40,4 @@ async function handleDelete() {
|
||||
</n-popconfirm>
|
||||
</n-flex>
|
||||
</template>
|
||||
<style scoped></style>
|
||||
<style scoped></style>
|
||||
|
||||
@@ -87,7 +87,11 @@ onMounted(init)
|
||||
/>
|
||||
</n-form-item>
|
||||
<n-form-item label="顺序">
|
||||
<n-input-number style="width: 100px" v-model:value="tutorial.order" :min="0" />
|
||||
<n-input-number
|
||||
style="width: 100px"
|
||||
v-model:value="tutorial.order"
|
||||
:min="0"
|
||||
/>
|
||||
</n-form-item>
|
||||
<n-form-item label="可见">
|
||||
<n-switch v-model:value="tutorial.is_public" />
|
||||
|
||||
13
src/env.d.ts
vendored
Normal file
13
src/env.d.ts
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
/// <reference types="@rsbuild/core/types" />
|
||||
|
||||
interface ImportMetaEnv {
|
||||
readonly PUBLIC_MAXKB_URL: string
|
||||
readonly PUBLIC_OJ_URL: string
|
||||
readonly PUBLIC_CODE_URL: string
|
||||
readonly PUBLIC_JUDGE0_URL: string
|
||||
readonly PUBLIC_ICONIFY_URL: string
|
||||
}
|
||||
|
||||
interface ImportMeta {
|
||||
readonly env: ImportMetaEnv
|
||||
}
|
||||
@@ -34,8 +34,8 @@ app.use(router)
|
||||
app.use(pinia)
|
||||
app.mount("#app")
|
||||
|
||||
if (!!import.meta.env.VITE_ICONIFY_URL) {
|
||||
if (!!import.meta.env.PUBLIC_ICONIFY_URL) {
|
||||
addAPIProvider("", {
|
||||
resources: [import.meta.env.VITE_ICONIFY_URL],
|
||||
resources: [import.meta.env.PUBLIC_ICONIFY_URL],
|
||||
})
|
||||
}
|
||||
|
||||
@@ -239,4 +239,4 @@ export function getTutorial(id: number) {
|
||||
|
||||
export function getTutorials() {
|
||||
return http.get("tutorials")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -92,7 +92,7 @@ async function select(key: string) {
|
||||
copy()
|
||||
break
|
||||
case "test":
|
||||
window.open(import.meta.env.VITE_CODE_URL, "_blank")
|
||||
window.open(import.meta.env.PUBLIC_CODE_URL, "_blank")
|
||||
break
|
||||
}
|
||||
}
|
||||
@@ -103,7 +103,7 @@ function changeLanguage(v: LANGUAGE) {
|
||||
}
|
||||
|
||||
function gotoTestCat() {
|
||||
const url = import.meta.env.VITE_CODE_URL
|
||||
const url = import.meta.env.PUBLIC_CODE_URL
|
||||
window.open(url, "_blank")
|
||||
}
|
||||
</script>
|
||||
|
||||
5
src/shims.d.ts
vendored
5
src/shims.d.ts
vendored
@@ -1,5 +0,0 @@
|
||||
declare module "*.md" {
|
||||
import type { ComponentOptions } from "vue"
|
||||
const Component: ComponentOptions
|
||||
export default Component
|
||||
}
|
||||
@@ -2,7 +2,7 @@ import axios from "axios"
|
||||
import { decode, encode } from "./functions"
|
||||
import { Code } from "./types"
|
||||
|
||||
const http = axios.create({ baseURL: import.meta.env.VITE_JUDGE0_URL })
|
||||
const http = axios.create({ baseURL: import.meta.env.PUBLIC_JUDGE0_URL })
|
||||
|
||||
export async function createTestSubmission(code: Code, input: string) {
|
||||
const encodedCode = encode(code.value)
|
||||
|
||||
@@ -384,7 +384,7 @@ export interface Tutorial {
|
||||
is_public: boolean
|
||||
order: number
|
||||
type: "python" | "c"
|
||||
created_by?: User
|
||||
created_by?: User
|
||||
updated_at?: Date
|
||||
created_at?: Date
|
||||
}
|
||||
}
|
||||
|
||||
13
src/vite-env.d.ts
vendored
13
src/vite-env.d.ts
vendored
@@ -1,13 +0,0 @@
|
||||
/// <reference types="vite/client" />
|
||||
|
||||
interface ImportMetaEnv {
|
||||
readonly VITE_MAXKB_URL: string
|
||||
readonly VITE_OJ_URL: string
|
||||
readonly VITE_CODE_URL: string
|
||||
readonly VITE_JUDGE0_URL: string
|
||||
readonly VITE_ICONIFY_URL: string
|
||||
}
|
||||
|
||||
interface ImportMeta {
|
||||
readonly env: ImportMetaEnv
|
||||
}
|
||||
Reference in New Issue
Block a user