| | |
| | | <svg-icon slot="prefix" icon-class="password" class="el-input__icon input-icon" /> |
| | | </el-input> |
| | | </el-form-item> |
| | | <el-form-item prop="code" v-if="captchaEnabled"> |
| | | <el-input |
| | | v-model="loginForm.code" |
| | | auto-complete="off" |
| | | placeholder="验证码" |
| | | style="width: 63%" |
| | | @keyup.enter.native="handleLogin" |
| | | > |
| | | <svg-icon slot="prefix" icon-class="validCode" class="el-input__icon input-icon" /> |
| | | </el-input> |
| | | <div class="login-code"> |
| | | <img :src="codeUrl" @click="getCode" class="login-code-img"/> |
| | | </div> |
| | | </el-form-item> |
| | | |
| | | <el-checkbox v-model="loginForm.rememberMe" style="margin:0px 0px 25px 0px;">记住密码</el-checkbox> |
| | | <el-form-item style="width:100%;"> |
| | | <el-button |
| | |
| | | </el-form-item> |
| | | </el-form> |
| | | <!-- 底部 --> |
| | | <div class="el-login-footer"> |
| | | <span>Copyright © 2018-2024 se.vip All Rights Reserved.</span> |
| | | </div> |
| | | |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | password: [ |
| | | { required: true, trigger: "blur", message: "请输入您的密码" } |
| | | ], |
| | | code: [{ required: true, trigger: "change", message: "请输入验证码" }] |
| | | // code: [{ required: true, trigger: "change", message: "请输入验证码" }] |
| | | }, |
| | | loading: false, |
| | | // 验证码开关 |
| | |
| | | } |
| | | }, |
| | | created() { |
| | | this.getCode(); |
| | | // this.getCode(); |
| | | this.getCookie(); |
| | | }, |
| | | methods: { |
| | | getCode() { |
| | | getCodeImg().then(res => { |
| | | this.captchaEnabled = res.captchaEnabled === undefined ? true : res.captchaEnabled; |
| | | if (this.captchaEnabled) { |
| | | this.codeUrl = "data:image/gif;base64," + res.img; |
| | | this.loginForm.uuid = res.uuid; |
| | | } |
| | | }); |
| | | }, |
| | | // getCode() { |
| | | // getCodeImg().then(res => { |
| | | // this.captchaEnabled = res.captchaEnabled === undefined ? true : res.captchaEnabled; |
| | | // if (this.captchaEnabled) { |
| | | // this.codeUrl = "data:image/gif;base64," + res.img; |
| | | // this.loginForm.uuid = res.uuid; |
| | | // } |
| | | // }); |
| | | // }, |
| | | getCookie() { |
| | | const username = Cookies.get("username"); |
| | | const password = Cookies.get("password"); |
| | |
| | | this.$router.push({ path: this.redirect || "/" }).catch(()=>{}); |
| | | }).catch(() => { |
| | | this.loading = false; |
| | | if (this.captchaEnabled) { |
| | | this.getCode(); |
| | | } |
| | | // if (this.captchaEnabled) { |
| | | // this.getCode(); |
| | | // } |
| | | }); |
| | | } |
| | | }); |