|
@@ -70,6 +70,7 @@
|
|
|
<script lang="ts">
|
|
<script lang="ts">
|
|
|
import { Component, Vue, Watch } from "vue-property-decorator";
|
|
import { Component, Vue, Watch } from "vue-property-decorator";
|
|
|
import user from "@/store/modules/user";
|
|
import user from "@/store/modules/user";
|
|
|
|
|
+import { RegAccount } from "@/utils";
|
|
|
@Component
|
|
@Component
|
|
|
export default class extends Vue {
|
|
export default class extends Vue {
|
|
|
private verifyImg = "";
|
|
private verifyImg = "";
|
|
@@ -87,6 +88,12 @@ export default class extends Vue {
|
|
|
}/captcha/info/captchaImage?t=${Date.now()}`;
|
|
}/captcha/info/captchaImage?t=${Date.now()}`;
|
|
|
}
|
|
}
|
|
|
async submit() {
|
|
async submit() {
|
|
|
|
|
+ if (!RegAccount.test(this.form.loginAccount))
|
|
|
|
|
+ return this.$message.error("您输入的账号错误");
|
|
|
|
|
+ if (!RegAccount.test(this.form.loginPassword))
|
|
|
|
|
+ return this.$message.error("您输入的密码错误");
|
|
|
|
|
+ if (this.form.validateCode.length !== 4)
|
|
|
|
|
+ return this.$message.error("您输入的验证码错误");
|
|
|
const token = await user.setToken(this.form);
|
|
const token = await user.setToken(this.form);
|
|
|
if (!token) return this.setVerifyImg();
|
|
if (!token) return this.setVerifyImg();
|
|
|
this.$message.success("登陆成功");
|
|
this.$message.success("登陆成功");
|