From 9ae5edaa7463bfa470dbbfbabdfbb4add5b0163f Mon Sep 17 00:00:00 2001
From: RuoYi <yzz_ivy@163.com>
Date: 星期六, 04 九月 2021 12:10:33 +0800
Subject: [PATCH] 菜单&部门新增展开/折叠功能
---
ruoyi-ui/src/views/login.vue | 28 ++++++++++++++++++++--------
1 files changed, 20 insertions(+), 8 deletions(-)
diff --git a/ruoyi-ui/src/views/login.vue b/ruoyi-ui/src/views/login.vue
index 6b2139e..255eafc 100644
--- a/ruoyi-ui/src/views/login.vue
+++ b/ruoyi-ui/src/views/login.vue
@@ -18,7 +18,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 +44,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-2021 ruoyi.vip All Rights Reserved.</span>
</div>
</div>
</template>
@@ -73,14 +76,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 +106,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() {
@@ -130,7 +140,9 @@
this.$router.push({ path: this.redirect || "/" }).catch(()=>{});
}).catch(() => {
this.loading = false;
- this.getCode();
+ if (this.captchaOnOff) {
+ this.getCode();
+ }
});
}
});
--
Gitblit v1.9.3