From a7e16d582d64691a8178de5b6d710acaf0e65a8c Mon Sep 17 00:00:00 2001
From: 若依 <yzz_ivy@163.com>
Date: 星期五, 20 五月 2022 15:56:27 +0800
Subject: [PATCH] !488 修复操作日志列表查询业务类型时的bug Merge pull request !488 from 也曾为你、像超人/N/A
---
ruoyi-ui/src/views/login.vue | 47 ++++++++++++++++++++++++++++++-----------------
1 files changed, 30 insertions(+), 17 deletions(-)
diff --git a/ruoyi-ui/src/views/login.vue b/ruoyi-ui/src/views/login.vue
index 574ca0b..6e240dd 100644
--- a/ruoyi-ui/src/views/login.vue
+++ b/ruoyi-ui/src/views/login.vue
@@ -3,7 +3,12 @@
<el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form">
<h3 class="title">鑻ヤ緷鍚庡彴绠$悊绯荤粺</h3>
<el-form-item prop="username">
- <el-input v-model="loginForm.username" type="text" auto-complete="off" placeholder="璐﹀彿">
+ <el-input
+ v-model="loginForm.username"
+ type="text"
+ auto-complete="off"
+ placeholder="璐﹀彿"
+ >
<svg-icon slot="prefix" icon-class="user" class="el-input__icon input-icon" />
</el-input>
</el-form-item>
@@ -18,7 +23,7 @@
<svg-icon slot="prefix" icon-class="password" class="el-input__icon input-icon" />
</el-input>
</el-form-item>
- <el-form-item prop="code">
+ <el-form-item prop="code" v-if="captchaOnOff">
<el-input
v-model="loginForm.code"
auto-complete="off"
@@ -44,11 +49,14 @@
<span v-if="!loading">鐧� 褰�</span>
<span v-else>鐧� 褰� 涓�...</span>
</el-button>
+ <div style="float: right;" v-if="register">
+ <router-link class="link-type" :to="'/register'">绔嬪嵆娉ㄥ唽</router-link>
+ </div>
</el-form-item>
</el-form>
<!-- 搴曢儴 -->
<div class="el-login-footer">
- <span>Copyright 漏 2018-2020 ruoyi.vip All Rights Reserved.</span>
+ <span>Copyright 漏 2018-2022 ruoyi.vip All Rights Reserved.</span>
</div>
</div>
</template>
@@ -63,7 +71,6 @@
data() {
return {
codeUrl: "",
- cookiePassword: "",
loginForm: {
username: "admin",
password: "admin123",
@@ -73,14 +80,18 @@
},
loginRules: {
username: [
- { required: true, trigger: "blur", message: "鐢ㄦ埛鍚嶄笉鑳戒负绌�" }
+ { required: true, trigger: "blur", message: "璇疯緭鍏ユ偍鐨勮处鍙�" }
],
password: [
- { required: true, trigger: "blur", message: "瀵嗙爜涓嶈兘涓虹┖" }
+ { required: true, trigger: "blur", message: "璇疯緭鍏ユ偍鐨勫瘑鐮�" }
],
- code: [{ required: true, trigger: "change", message: "楠岃瘉鐮佷笉鑳戒负绌�" }]
+ code: [{ required: true, trigger: "change", message: "璇疯緭鍏ラ獙璇佺爜" }]
},
loading: false,
+ // 楠岃瘉鐮佸紑鍏�
+ captchaOnOff: true,
+ // 娉ㄥ唽寮�鍏�
+ register: false,
redirect: undefined
};
},
@@ -99,8 +110,11 @@
methods: {
getCode() {
getCodeImg().then(res => {
- this.codeUrl = "data:image/gif;base64," + res.img;
- this.loginForm.uuid = res.uuid;
+ this.captchaOnOff = res.captchaOnOff === undefined ? true : res.captchaOnOff;
+ if (this.captchaOnOff) {
+ this.codeUrl = "data:image/gif;base64," + res.img;
+ this.loginForm.uuid = res.uuid;
+ }
});
},
getCookie() {
@@ -126,15 +140,14 @@
Cookies.remove("password");
Cookies.remove('rememberMe');
}
- this.$store
- .dispatch("Login", this.loginForm)
- .then(() => {
- this.$router.push({ path: this.redirect || "/" });
- })
- .catch(() => {
- this.loading = false;
+ this.$store.dispatch("Login", this.loginForm).then(() => {
+ this.$router.push({ path: this.redirect || "/" }).catch(()=>{});
+ }).catch(() => {
+ this.loading = false;
+ if (this.captchaOnOff) {
this.getCode();
- });
+ }
+ });
}
});
}
--
Gitblit v1.9.3