增加错误处理
This commit is contained in:
parent
9ac12b7627
commit
df3bc23cfc
|
|
@ -30,9 +30,19 @@
|
||||||
title: ''
|
title: ''
|
||||||
})
|
})
|
||||||
async function init() {
|
async function init() {
|
||||||
const res = await Api.getVideoDetail(options)
|
try {
|
||||||
Object.assign(state, res)
|
const res = await Api.getVideoDetail(options)
|
||||||
state.list = res.list
|
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}){
|
function update({index,item}){
|
||||||
state.list[index]=item
|
state.list[index]=item
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue