支持全局异常和统一返回结果

This commit is contained in:
648540858
2022-08-22 16:16:31 +08:00
parent 5461b8ebf2
commit 042b28b2d6
31 changed files with 461 additions and 186 deletions

View File

@@ -168,12 +168,14 @@
count: that.count
}
}).then(function (res) {
that.total = res.data.total;
for (let i = 0; i < res.data.list.length; i++) {
res.data.list[i]["startBtnLoading"] = false;
if (res.data.code === 0) {
that.total = res.data.data.total;
for (let i = 0; i < res.data.data.list.length; i++) {
res.data.data.list[i]["startBtnLoading"] = false;
}
that.streamProxyList = res.data.data.list;
}
that.streamProxyList = res.data.list;
that.getListLoading = false;
that.getListLoading = false;
}).catch(function (error) {
console.log(error);
that.getListLoading = false;
@@ -190,7 +192,7 @@
url:`/api/onvif/search?timeout=3000`,
}).then((res) =>{
this.getListLoading = false;
if (res.data.code == 0 ){
if (res.data.code === 0 ){
if (res.data.data.length > 0) {
this.$refs.onvifEdit.openDialog(res.data.data, (url)=>{
if (url != null) {
@@ -277,7 +279,7 @@
}).then(function (res) {
that.getListLoading = false;
that.$set(row, 'startBtnLoading', false)
if (res.data == "success"){
if (res.data.code === 0){
that.initData()
}else {
that.$message({