From 2a033574ad9fd72d7a549bac6dbb12fefd11c60d Mon Sep 17 00:00:00 2001 From: unclekh <5177787+unclekh@user.noreply.gitee.com> Date: Mon, 18 May 2020 22:43:12 +0800 Subject: [PATCH] =?UTF-8?q?loading=E7=99=BB=E5=BD=95=EF=BC=8C=E4=BB=A5?= =?UTF-8?q?=E5=8F=8A=E8=8E=B7=E5=8F=96=E7=94=A8=E6=88=B7=E6=88=90=E7=BB=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/common/header.vue | 889 +++++++++++++++---------------- src/pages/yyyfLogin.vue | 36 +- 2 files changed, 446 insertions(+), 479 deletions(-) diff --git a/src/components/common/header.vue b/src/components/common/header.vue index 8571fb3..4872c03 100644 --- a/src/components/common/header.vue +++ b/src/components/common/header.vue @@ -192,543 +192,510 @@ diff --git a/src/pages/yyyfLogin.vue b/src/pages/yyyfLogin.vue index 9909ada..89bc795 100644 --- a/src/pages/yyyfLogin.vue +++ b/src/pages/yyyfLogin.vue @@ -10,6 +10,7 @@ import {FILE_URL} from '@/api/app'; import {signIn} from '@/api/yyyf'; import {Loading} from 'element-ui'; + export default { name: 'yyyfLogin', props: {}, @@ -21,39 +22,35 @@ }, computed: {}, - - created() { this.startLoading(); let params = this.parseUrl(); //判断是否来自以渔有方 - if (!$.isEmptyObject(params) &¶ms.userId != undefined && params.reqType != undefined) { + if (!$.isEmptyObject(params) && params.userId != undefined && params.reqType != undefined) { this.loginFromYyyf(params); - }else{ - let self=this; + } else { this.$alert('参数错误', '提示', { - type:'error', - showClose:false, + type: 'error', + showClose: false, confirmButtonText: '确定', confirmButtonClass: 'btn-self-style', callback: action => { - self.closeWindow() + this.closeWindow() } }); } - }, methods: { startLoading: function () { //使用Element loading-start 方法 this.loading = Loading.service({ lock: true, - text: '初始化登录1ing...', + text: '初始化登录ing...', background: 'rgba(204, 0, 0, 0.7)' - }) + }); }, endLoading: function () { //使用Element loading-close 方法 - loading.close() + this.loading.close() }, parseUrl: function () { let params = {}; //定义数组 @@ -88,8 +85,6 @@ signIn(params).then(res => { // console.log(res); if (res.data.code === 200) { - debugger; - this.loading = false; //保存登录的token到cookie // Cookie.set('token', res.data.data.token); localStorage.setItem('yyyfToken', res.data.data.yyyfUserToken); @@ -100,8 +95,13 @@ this.endLoading() location.href = '/'; } else { - //this.loading = false; - this.$message.warning(res.data.msg); + self.$message.warning({ + message: res.data.msg, + onClose: function () { + this.closeWindow(); + } + }); + } }); }, @@ -120,8 +120,8 @@