| | |
| | | <template> |
| | | <div class="login-wrapper"> |
| | | <div class="auto-login-loading" v-if="isAutoLogin"> |
| | | <img src="../assets/images/loading-open.gif"> |
| | | </div> |
| | | <div class="login-wrapper" v-else> |
| | | <div class="login_container"> |
| | | <div class="sliderCon"> |
| | | <div class="logo"> |
| | |
| | | readSeconds: readSeconds?readSeconds:0, |
| | | codeBtnLoading: false, |
| | | showName: true, |
| | | isAutoLogin: true, |
| | | }; |
| | | }, |
| | | created() { |
| | |
| | | this.loading = false; |
| | | let rs = JSON.parse(res.data.result); |
| | | if (rs.code == 1) { |
| | | console.log(rs); |
| | | this.$message.success("登录成功"); |
| | | // 非自动登录提示登录成功 |
| | | if(!this.isAutoLogin) { |
| | | this.$message.success("登录成功"); |
| | | } |
| | | // 重置登录时间 |
| | | this.readSeconds = 0; |
| | | sessionStorage.setItem("readSeconds", "0"); |
| | |
| | | this.$apis.userMager.userInfo |
| | | .getUserLoginInfo(uid) |
| | | .then((res) => { |
| | | let rs = JSON.parse(res.data.result); |
| | | if (rs.code == 1) { |
| | | let data = rs.data; |
| | | this.$store.dispatch("user/changeAutoLogin", 1); |
| | | this.$store.dispatch("user/changePage", pageName); |
| | | this.loginForm.username = data.UName; |
| | | this.loginForm.password = data.USnId; |
| | | this.normalLogin(); |
| | | } else { |
| | | this.init(); |
| | | } |
| | | this.$store.dispatch("user/changeAutoLogin", 1); |
| | | this.$store.dispatch("user/changePage", pageName); |
| | | this.handleLogin(res, true); |
| | | }) |
| | | .catch((error) => { |
| | | this.$notify.error({ |
| | |
| | | this.changeVerifyCode(); |
| | | let autoLogin = this.$route.query.autoLogin; |
| | | if (autoLogin) { |
| | | this.isAutoLogin = true; |
| | | // 自动登录 |
| | | this.autoLogin(); |
| | | } else { |
| | | this.isAutoLogin = false; |
| | | // 初始化 |
| | | this.init(); |
| | | } |
| | |
| | | </script> |
| | | |
| | | <style> |
| | | .auto-login-loading { |
| | | display: flex; |
| | | height: 100%; |
| | | flex-direction: row; |
| | | justify-content: center; |
| | | align-items: center; |
| | | background-color: #E7EBEF; |
| | | } |
| | | .login_from .el-input__inner { |
| | | height: 48px; |
| | | line-height: 48px; |