tutorials from remote
This commit is contained in:
20
src/api.ts
20
src/api.ts
@@ -90,18 +90,18 @@ export const Tutorial = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
async get(display: number) {
|
async get(display: number) {
|
||||||
// const res = await http.get(`/tutorial/${display}`)
|
const res = await http.get(`/tutorial/${display}`)
|
||||||
// return res.data
|
return res.data
|
||||||
const res = await fetch(`/tutorial/${display}/README.md`)
|
// const res = await fetch(`/tutorial/${display}/README.md`)
|
||||||
const content = await res.text()
|
// const content = await res.text()
|
||||||
return { content }
|
// return { content }
|
||||||
},
|
},
|
||||||
|
|
||||||
async listDisplay() {
|
async listDisplay() {
|
||||||
// const res = await http.get("/tutorial/display")
|
const res = await http.get("/tutorial/display")
|
||||||
// return res.data
|
return res.data
|
||||||
const res = await fetch("/tutorial/README.md")
|
// const res = await fetch("/tutorial/README.md")
|
||||||
const text = await res.text()
|
// const text = await res.text()
|
||||||
return text.split("\n").map((item) => Number(item.split(" ")[0]))
|
// return text.split("\n").map((item) => Number(item.split(" ")[0]))
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
</n-flex>
|
</n-flex>
|
||||||
<n-flex>
|
<n-flex>
|
||||||
<n-button
|
<n-button
|
||||||
v-if="false && authed && roleSuper"
|
v-if="authed && roleSuper"
|
||||||
quaternary
|
quaternary
|
||||||
@click="$router.push({ name: 'tutorial', params: { display: step } })"
|
@click="$router.push({ name: 'tutorial', params: { display: step } })"
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -9,7 +9,6 @@
|
|||||||
:key="item.label"
|
:key="item.label"
|
||||||
:type="$route.name === item.route.name ? 'primary' : 'default'"
|
:type="$route.name === item.route.name ? 'primary' : 'default'"
|
||||||
@click="$router.push(item.route)"
|
@click="$router.push(item.route)"
|
||||||
:disabled="item.disabled"
|
|
||||||
>
|
>
|
||||||
{{ item.label }}
|
{{ item.label }}
|
||||||
</n-button>
|
</n-button>
|
||||||
@@ -26,7 +25,6 @@ const menu = [
|
|||||||
{
|
{
|
||||||
label: "教程",
|
label: "教程",
|
||||||
route: { name: "tutorial", params: { display: step.value } },
|
route: { name: "tutorial", params: { display: step.value } },
|
||||||
disabled: true
|
|
||||||
},
|
},
|
||||||
{ label: "用户", route: { name: "user-manage", params: { page: 1 } } },
|
{ label: "用户", route: { name: "user-manage", params: { page: 1 } } },
|
||||||
]
|
]
|
||||||
|
|||||||
Reference in New Issue
Block a user