From 12ce08f5a56e459b32c4e1a2fde6a58f0abd0a6b Mon Sep 17 00:00:00 2001 From: xuechunyuan <17853500702@163.com> Date: Wed, 22 Feb 2023 11:36:25 +0800 Subject: [PATCH] =?UTF-8?q?=E9=BB=91=E5=90=8D=E5=8D=95=E6=A0=A1=E9=AA=8Clo?= =?UTF-8?q?ading?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/HomeView.vue | 53 +++++++++++++++++++++++++++--------------- 1 file changed, 34 insertions(+), 19 deletions(-) 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(); + } } } },