增加错误处理
This commit is contained in:
parent
9ac12b7627
commit
df3bc23cfc
|
|
@ -30,9 +30,19 @@
|
|||
title: ''
|
||||
})
|
||||
async function init() {
|
||||
const res = await Api.getVideoDetail(options)
|
||||
Object.assign(state, res)
|
||||
state.list = res.list
|
||||
try {
|
||||
const res = await Api.getVideoDetail(options)
|
||||
Object.assign(state, res)
|
||||
state.list = res.list
|
||||
} catch (error) {
|
||||
// if(getCurrentPages().length>=2){
|
||||
// uni.navigateBack()
|
||||
// }else{
|
||||
// uni.switchTab({
|
||||
// url:'/pages/index/index'
|
||||
// })
|
||||
// }
|
||||
}
|
||||
}
|
||||
function update({index,item}){
|
||||
state.list[index]=item
|
||||
|
|
|
|||
Loading…
Reference in New Issue