From 14699711028f0d157eddfb0432e26ab91f1b4493 Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: 星期二, 22 十一月 2022 15:02:25 +0800 Subject: [PATCH] 支持配置设备上线时自动更新查询通道,修复通道刷新进度展示 --- web_src/src/components/Login.vue | 18 +++++++++++------- 1 files changed, 11 insertions(+), 7 deletions(-) diff --git a/web_src/src/components/Login.vue b/web_src/src/components/Login.vue index 2b544bc..37c8a83 100644 --- a/web_src/src/components/Login.vue +++ b/web_src/src/components/Login.vue @@ -22,7 +22,7 @@ </div> <div class="container-login100-form-btn"> - <div class="wrap-login100-form-btn"> + <div class="wrap-login100-form-btn" :class="{'login-loading': isLoging}" v-loading="isLoging" element-loading-background="rgb(0 0 0 / 0%);" element-loading-custom-class="login-loading-class"> <div class="login100-form-bgbtn"></div> <button class="login100-form-btn" @click="login">鐧诲綍</button> </div> @@ -41,6 +41,7 @@ return { isLoging: false, showPassword: false, + loginLoading: false, username: '', password: '' } @@ -65,10 +66,6 @@ //鐧诲綍璇锋眰 toLogin(){ - - //涓�鑸璺熷悗绔簡瑙e瘑鐮佺殑鍔犲瘑瑙勫垯 - //杩欓噷渚嬪瓙鐢ㄧ殑鍝堝笇绠楁硶鏉ヨ嚜./js/sha1.min.js - //闇�瑕佹兂鍚庣鍙戦�佺殑鐧诲綍鍙傛暟 let loginParam = { username: this.username, @@ -77,15 +74,20 @@ var that = this; //璁剧疆鍦ㄧ櫥褰曠姸鎬� this.isLoging = true; + let timeoutTask = setTimeout(()=>{ + that.$message.error("鐧诲綍瓒呮椂"); + that.isLoging = false; + }, 1000) this.$axios({ method: 'get', url:"/api/user/login", params: loginParam }).then(function (res) { + window.clearTimeout(timeoutTask) console.log(JSON.stringify(res)); - if (res.data.code == 0 && res.data.msg == "success") { - that.$cookies.set("session", {"username": that.username}) ; + if (res.data.code === 0 ) { + that.$cookies.set("session", {"username": that.username,"roleId":res.data.data.role.id}) ; //鐧诲綍鎴愬姛鍚� that.cancelEnterkeyDefaultAction(); that.$router.push('/'); @@ -98,6 +100,8 @@ }); } }).catch(function (error) { + console.log(error) + window.clearTimeout(timeoutTask) that.$message.error(error.response.data.msg); that.isLoging = false; }); -- Gitblit v1.8.0