use local md file

This commit is contained in:
2025-03-10 19:07:09 +08:00
parent 544a046365
commit a2d0f42ae6
7 changed files with 481 additions and 6 deletions

View File

@@ -63,10 +63,10 @@ export const Account = {
return res.data
},
async batchCreate(payload: {classname: string, names: string[]}) {
async batchCreate(payload: { classname: string; names: string[] }) {
const res = await http.post("/account/batch", payload)
return res.data
}
},
}
export const Tutorial = {
@@ -90,12 +90,18 @@ export const Tutorial = {
},
async get(display: number) {
const res = await http.get(`/tutorial/${display}`)
return res.data
// const res = await http.get(`/tutorial/${display}`)
// return res.data
const res = await fetch(`/tutorial/${display}/README.md`)
const content = await res.text()
return { content }
},
async listDisplay() {
const res = await http.get("/tutorial/display")
return res.data
// const res = await http.get("/tutorial/display")
// return res.data
const res = await fetch("/tutorial/README.md")
const text = await res.text()
return text.split("\n").map((item) => Number(item.split(" ")[0]))
},
}