处理接口失败情况

This commit is contained in:
a0049873 2022-11-28 14:53:47 +08:00
parent d5722586e7
commit 689d308864
1 changed files with 28 additions and 0 deletions

View File

@ -484,6 +484,10 @@
yaweiApproveDetails({ applyGuid: item.GUID }) yaweiApproveDetails({ applyGuid: item.GUID })
.then((res) => { .then((res) => {
console.log('详情===========>', res.data.data) console.log('详情===========>', res.data.data)
if (res.data.code !== 0) {
message.error('数据请求失败!')
return
}
res.data.data.map((val) => { res.data.data.map((val) => {
val.clsj = moment(val.clsj).format('YYYY-MM-DD HH:mm:ss') val.clsj = moment(val.clsj).format('YYYY-MM-DD HH:mm:ss')
}) })
@ -717,6 +721,14 @@
} else if (typeName.value == '数据资源申请') { } else if (typeName.value == '数据资源申请') {
yaweiApproveStatus({ page: page.value, size: 4, title: '' }).then( yaweiApproveStatus({ page: page.value, size: 4, title: '' }).then(
(res) => { (res) => {
if (res.data.code !== 0) {
num.value = []
total.value = 0
contentList.data = []
contentList2.data = []
showType.value = ''
return
}
console.log('数据资源申请===============>', res.data.data) console.log('数据资源申请===============>', res.data.data)
contentList.data = res.data.data.data contentList.data = res.data.data.data
num.value = [] num.value = []
@ -727,6 +739,14 @@
} else if (typeName.value == '云资源申请') { } else if (typeName.value == '云资源申请') {
getResourceBusinessList({ userAccount: userName.value }).then((res) => { getResourceBusinessList({ userAccount: userName.value }).then((res) => {
console.log('数据资源申请===============>', res.data.data) console.log('数据资源申请===============>', res.data.data)
if (res.data.code !== 0) {
num.value = []
total.value = 0
contentList.data = []
contentList2.data = []
showType.value = ''
return
}
contentList.data = res.data.data contentList.data = res.data.data
contentList2.data = res.data.data contentList2.data = res.data.data
num.value = [] num.value = []
@ -735,6 +755,14 @@
}) })
} else if (typeName.value == '云视频申请') { } else if (typeName.value == '云视频申请') {
getVideoBusinessList({ userAccount: userName.value }).then((res) => { getVideoBusinessList({ userAccount: userName.value }).then((res) => {
if (res.data.code !== 0) {
num.value = []
total.value = 0
contentList.data = []
contentList2.data = []
showType.value = ''
return
}
console.log('数据资源申请===============>', res.data.data) console.log('数据资源申请===============>', res.data.data)
contentList.data = res.data.data contentList.data = res.data.data
contentList2.data = res.data.data contentList2.data = res.data.data