diff --git a/src/views/HomeView.vue b/src/views/HomeView.vue index e3f0154..b074d34 100644 --- a/src/views/HomeView.vue +++ b/src/views/HomeView.vue @@ -119,29 +119,44 @@ export default { // console.log(this.userInfo.papersnumber) if (this.userInfo) { // console.log(this.userInfo.papersnumber); + this.$toast.loading({ + message: '请求中', + duration: 0, + }) if (this.GlobalConfig.appMode) { - vaildInterfacefn("cgstjyyjzpzp", "qdsgajjtjczdyhhmdyz", JSON.stringify({ cupCardNo: this.userInfo.papersnumber }), "2", "https://" + this.GlobalConfig.urlCreatesign, "https://" + this.GlobalConfig.urlGateway).then((value) => { + try { + vaildInterfacefn("cgstjyyjzpzp", "qdsgajjtjczdyhhmdyz", JSON.stringify({ cupCardNo: this.userInfo.papersnumber }), "2", "https://" + this.GlobalConfig.urlCreatesign, "https://" + this.GlobalConfig.urlGateway).then((value) => { + this.$toast.clear(); + let retData = JSON.parse(value); + if (retData.code == 200 && retData.data) { + this.errMsg = retData.data; + this.isShowError = true; + } else { + this.$router.push({ name: 'guidance', query: { deptId: id } }) + } + }, err => { + this.$toast.clear(); + }) + } catch (error) { this.$toast.clear(); - let retData = JSON.parse(value); - if (retData.code == 200 && retData.data) { - this.errMsg = retData.data; - this.isShowError = true; - } else { - this.$router.push({ name: 'guidance', query: { deptId: id } }) - } - }, err => { - this.$toast.clear(); - }) + } } else { - checkBacklist(this.userInfo.papersnumber).then(res => { - if (res.data) { - this.errMsg = res.data; - this.isShowError = true; - } else { - this.$router.push({ name: 'guidance', query: { deptId: id } }) - } - }) + try { + checkBacklist(this.userInfo.papersnumber).then(res => { + this.$toast.clear(); + if (res.data) { + this.errMsg = res.data; + this.isShowError = true; + } else { + this.$router.push({ name: 'guidance', query: { deptId: id } }) + } + }, err => { + this.$toast.clear(); + }) + } catch (error) { + this.$toast.clear(); + } } } },