|
@@ -66,7 +66,7 @@
|
|
size="large"
|
|
size="large"
|
|
v-model="loginForm.password"
|
|
v-model="loginForm.password"
|
|
:placeholder="passwordInputPlaceholder"
|
|
:placeholder="passwordInputPlaceholder"
|
|
- @on-enter="login('loginForm')"
|
|
|
|
|
|
+ @on-enter="login"
|
|
>
|
|
>
|
|
<i-icon type="ios-lock" slot="prepend"></i-icon>
|
|
<i-icon type="ios-lock" slot="prepend"></i-icon>
|
|
</i-input>
|
|
</i-input>
|
|
@@ -83,7 +83,7 @@
|
|
class="qm-primary-button"
|
|
class="qm-primary-button"
|
|
long
|
|
long
|
|
:disabled="disableLoginBtn"
|
|
:disabled="disableLoginBtn"
|
|
- @click="login('loginForm')"
|
|
|
|
|
|
+ @click="login"
|
|
>
|
|
>
|
|
登录
|
|
登录
|
|
</i-button>
|
|
</i-button>
|
|
@@ -249,14 +249,15 @@ export default {
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
...mapMutations(["updateUser", "updateTimeDifference"]),
|
|
...mapMutations(["updateUser", "updateTimeDifference"]),
|
|
- async login(name) {
|
|
|
|
|
|
+ async login() {
|
|
if (this.disableLoginBtn) {
|
|
if (this.disableLoginBtn) {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
await this.checkNewVersion();
|
|
await this.checkNewVersion();
|
|
this.disableLoginBtn = true;
|
|
this.disableLoginBtn = true;
|
|
setTimeout(() => (this.disableLoginBtn = false), 5000);
|
|
setTimeout(() => (this.disableLoginBtn = false), 5000);
|
|
- const valid = await this.$refs[name].validate();
|
|
|
|
|
|
+ // https://www.cnblogs.com/weiqinl/p/6708993.html
|
|
|
|
+ const valid = await this.$refs.loginForm.validate();
|
|
if (valid) {
|
|
if (valid) {
|
|
console.log("form validated. start login...");
|
|
console.log("form validated. start login...");
|
|
} else {
|
|
} else {
|