From 61034d4ddecd0b3056a7fb38a737b0e0cfc33b9c Mon Sep 17 00:00:00 2001
From: RuoYi <yzz_ivy@163.com>
Date: 星期日, 27 三月 2022 14:36:31 +0800
Subject: [PATCH] 优化导出excel单元格验证,包含变更为开头.防止正常内容被替换
---
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.2