fix
This commit is contained in:
@@ -74,16 +74,17 @@ async function listRanks() {
|
|||||||
|
|
||||||
async function getRandom() {
|
async function getRandom() {
|
||||||
const res = await randomUser10(query.classroom)
|
const res = await randomUser10(query.classroom)
|
||||||
if (!res.data.length) return false
|
|
||||||
const name = res.data[res.data.length - 1]
|
const name = res.data[res.data.length - 1]
|
||||||
luckyGuy.value = name.split(query.classroom)[1]
|
luckyGuy.value = name.split(query.classroom)[1]
|
||||||
return true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async function getRandomModal() {
|
async function getRandomModal() {
|
||||||
const ok = await getRandom()
|
try {
|
||||||
if (ok) showModal.value = true
|
await getRandom()
|
||||||
else message.error("没有学生")
|
showModal.value = true
|
||||||
|
} catch (error) {
|
||||||
|
message.error("没有学生")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
watch(() => query.page, listRanks)
|
watch(() => query.page, listRanks)
|
||||||
|
|||||||
Reference in New Issue
Block a user