update
Some checks failed
Deploy / deploy (build, debian, 22) (push) Has been cancelled
Deploy / deploy (build:staging, school, 8822) (push) Has been cancelled

This commit is contained in:
2026-03-04 00:04:45 +08:00
parent 564f0b3f21
commit 78a2d84335
17 changed files with 687 additions and 310 deletions

View File

@@ -1,6 +1,6 @@
import axios from "axios"
import { router } from "./router"
import type { TutorialIn } from "./utils/type"
import type { TutorialIn, ChallengeIn } from "./utils/type"
import { BASE_URL, STORAGE_KEY } from "./utils/const"
const http = axios.create({
@@ -100,6 +100,37 @@ export const Tutorial = {
},
}
export const Challenge = {
async list() {
const res = await http.get("/challenge/list")
return res.data
},
async createOrUpdate(payload: ChallengeIn) {
const res = await http.post("/challenge/", payload)
return res.data
},
async togglePublic(display: number) {
const res = await http.put(`/challenge/public/${display}`)
return res.data
},
async remove(display: number) {
await http.delete(`/challenge/${display}`)
},
async get(display: number) {
const res = await http.get(`/challenge/${display}`)
return res.data
},
async listDisplay() {
const res = await http.get("/challenge/display")
return res.data
},
}
export const Submission = {
async create(
taskId: number,