|
@@ -61,6 +61,7 @@
|
|
|
</template>
|
|
|
<script lang="ts">
|
|
|
import { Component, Vue, Watch } from "vue-property-decorator";
|
|
|
+import { RegAccount } from "@/utils";
|
|
|
@Component
|
|
|
export default class extends Vue {
|
|
|
private flag = false;
|
|
@@ -71,8 +72,17 @@ export default class extends Vue {
|
|
|
};
|
|
|
|
|
|
async submit() {
|
|
|
+ if (!RegAccount.test(this.form.loginAccount))
|
|
|
+ return this.$message.error("请输入8到12位由数字字母组合的账号");
|
|
|
+ if (!RegAccount.test(this.form.loginPassword))
|
|
|
+ return this.$message.error("请输入8到12位由数字字母组合的密码");
|
|
|
+ if (!/^1[3456789]\d{9}$/.test(this.form.phone))
|
|
|
+ return this.$message.error("请正确输入手机号");
|
|
|
+ if (!this.flag) return this.$message.error("请同意服务条款");
|
|
|
const [err] = await this.$post("/member/info/userRegister", this.form);
|
|
|
- if (!err) return this.$message.success("注册成功");
|
|
|
+ if (err) return;
|
|
|
+ this.$message.success("注册成功 请登陆");
|
|
|
+ this.$router.push("/login");
|
|
|
}
|
|
|
}
|
|
|
</script>
|