update
This commit is contained in:
@@ -7,9 +7,14 @@ const hitokoto = reactive({
|
||||
})
|
||||
|
||||
async function receive() {
|
||||
const res = await getHitokoto()
|
||||
hitokoto.sentence = res.data.hitokoto
|
||||
hitokoto.from = res.data.from
|
||||
try {
|
||||
const res = await getHitokoto()
|
||||
hitokoto.sentence = res.data.hitokoto
|
||||
hitokoto.from = res.data.from
|
||||
} catch (error) {
|
||||
hitokoto.sentence = "获取一言失败,请点击重试"
|
||||
hitokoto.from = "DEV"
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(receive)
|
||||
|
||||
Reference in New Issue
Block a user