fix: BUG修改

This commit is contained in:
kun 2024-05-25 09:48:26 +08:00
parent 4c8a0ee8da
commit 7f8508a6e0

View File

@ -56,7 +56,7 @@ export default {
// const idCard = this.value; // const idCard = this.value;
const res = await entryCodeApi(params); const res = await entryCodeApi(params);
console.log(res); console.log(res);
if (res.success == true) { if (res.success == true && res.result) {
this.id = res.result.id; this.id = res.result.id;
console.log("this.id:" + this.id); console.log("this.id:" + this.id);
this.$router.push({ this.$router.push({
@ -65,14 +65,18 @@ export default {
}); });
// this.$router.push({path: '/entryCodeDetail'}); // this.$router.push({path: '/entryCodeDetail'});
} else { } else {
console.log("没有查到信息"); // console.log("");
this.$message({
type: "error",
message: "没有查到相关信息",
});
} }
}, },
validateIdCard() { validateIdCard() {
// //
const idCardRegex = const idCardRegex =
/^[1-9]\d{5}(19|20)\d{2}(0[1-9]|1[0-2])([0-2][1-9]|10|20|30)\d{3}[\dX]$/; /^[1-9]\d{5}(18|19|20|21|22)?\d{2}(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])\d{3}(\d|[Xx])$/;
// //
this.isValidIdCard = idCardRegex.test(this.value); this.isValidIdCard = idCardRegex.test(this.value);
}, },