|
@@ -56,6 +56,7 @@
|
|
placeholder="请输入账号"
|
|
placeholder="请输入账号"
|
|
clearable
|
|
clearable
|
|
v-model="inputForm.username"
|
|
v-model="inputForm.username"
|
|
|
|
+ @blur="getLoginCodeNumber($event.target.value)"
|
|
></el-input>
|
|
></el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item prop="password">
|
|
<el-form-item prop="password">
|
|
@@ -68,7 +69,7 @@
|
|
></el-input>
|
|
></el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
|
|
|
- <el-row :gutter="10">
|
|
|
|
|
|
+ <el-row :gutter="10" v-if="inputForm.isShow">
|
|
<el-col :span="16">
|
|
<el-col :span="16">
|
|
<el-form-item prop="code">
|
|
<el-form-item prop="code">
|
|
<el-input
|
|
<el-input
|
|
@@ -114,6 +115,7 @@ export default {
|
|
logo: "",
|
|
logo: "",
|
|
productName: "",
|
|
productName: "",
|
|
loading: false,
|
|
loading: false,
|
|
|
|
+ isShow: false,
|
|
captchaImg: "",
|
|
captchaImg: "",
|
|
inputForm: {
|
|
inputForm: {
|
|
username: "admin",
|
|
username: "admin",
|
|
@@ -162,7 +164,10 @@ export default {
|
|
this.$store.commit("clearIframeList");
|
|
this.$store.commit("clearIframeList");
|
|
},
|
|
},
|
|
mounted() {
|
|
mounted() {
|
|
- this.getCaptcha();
|
|
|
|
|
|
+ // this.getCaptcha();
|
|
|
|
+ if (this.inputForm.username) {
|
|
|
|
+ this.getLoginCodeNumber(this.inputForm.username)
|
|
|
|
+ }
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
appName() {
|
|
appName() {
|
|
@@ -230,7 +235,7 @@ export default {
|
|
})
|
|
})
|
|
.catch(() => {
|
|
.catch(() => {
|
|
this.loading = false;
|
|
this.loading = false;
|
|
- this.getCaptcha();
|
|
|
|
|
|
+ this.getLoginErrorMethod();
|
|
});
|
|
});
|
|
}
|
|
}
|
|
});
|
|
});
|
|
@@ -249,6 +254,35 @@ export default {
|
|
this.inputForm.uuid = data.uuid;
|
|
this.inputForm.uuid = data.uuid;
|
|
});
|
|
});
|
|
},
|
|
},
|
|
|
|
+ //登陆失败时访问的方法
|
|
|
|
+ getLoginErrorMethod() {
|
|
|
|
+ loginService.getCode().then((data) => {
|
|
|
|
+ this.captchaImg = "data:image/gif;base64," + data.codeImg;
|
|
|
|
+ this.inputForm.uuid = data.uuid;
|
|
|
|
+ });
|
|
|
|
+ if (this.inputForm.username) {
|
|
|
|
+ loginService.getLoginCodeNumber(this.inputForm.username).then((data) => {
|
|
|
|
+ if (data.redisLoginNumber >= data.loginNumber) {
|
|
|
|
+ this.inputForm.isShow = true
|
|
|
|
+ } else {
|
|
|
|
+ this.inputForm.isShow = false
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ // 获取验证码
|
|
|
|
+ getLoginCodeNumber(username) {
|
|
|
|
+ loginService.getLoginCodeNumber(username).then((data) => {
|
|
|
|
+ if (data.redisLoginNumber >= data.loginNumber) {
|
|
|
|
+ if (!this.inputForm.isShow) {
|
|
|
|
+ this.getCaptcha()
|
|
|
|
+ this.inputForm.isShow = true
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ this.inputForm.isShow = false
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
// 切换语言
|
|
// 切换语言
|
|
changeLanguage(language) {
|
|
changeLanguage(language) {
|
|
this.$TOOL.data.set("APP_LANG", language);
|
|
this.$TOOL.data.set("APP_LANG", language);
|