This commit is contained in:
lll 2023-11-13 22:37:10 +08:00
parent bdfc249089
commit a22f92c215
5 changed files with 29 additions and 11 deletions

View File

@ -694,6 +694,8 @@ export default {
}; };
}, },
created() { created() {
alert(this.$route.query.id, this.$store.state.type);
console.log(this.user_id, this.$store.state.type);
this.GetUserAnswer(); this.GetUserAnswer();
}, },
mounted() {}, mounted() {},

View File

@ -488,7 +488,7 @@ export default {
) { ) {
callback(new Error("请输入主DNS服务器地址")); callback(new Error("请输入主DNS服务器地址"));
} else if ( } else if (
!isValidPrimaryDNS( !this.isValidDNSAddress(
this.ippz_dns_zy1 + this.ippz_dns_zy1 +
"." + "." +
this.ippz_dns_zy2 + this.ippz_dns_zy2 +
@ -503,6 +503,16 @@ export default {
callback(); callback();
} }
}, },
isValidDNSAddress(value) {
// IPv4
const ipv4Regex = /^(\d{1,3}\.){3}\d{1,3}$/;
// IPv6
const ipv6Regex = /^(?:[0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}$/;
// IPv4IPv6
return ipv4Regex.test(value) || ipv6Regex.test(value);
},
//dns //dns
validatePrimaryDNS1(rule, value, callback) { validatePrimaryDNS1(rule, value, callback) {
if ( if (
@ -517,7 +527,7 @@ export default {
) { ) {
callback(new Error("请输入备用DNS服务器地址")); callback(new Error("请输入备用DNS服务器地址"));
} else if ( } else if (
!isValidPrimaryDNS( !this.isValidDNSAddress(
this.ippz_dns_by1 + this.ippz_dns_by1 +
"." + "." +
this.ippz_dns_by2 + this.ippz_dns_by2 +

View File

@ -236,6 +236,8 @@ export default {
} else { } else {
this.$store.commit("setType", "GYWZ_wx"); this.$store.commit("setType", "GYWZ_wx");
} }
alert(this.user_id, this.$store.state.type);
console.log(this.user_id, this.$store.state.type);
this.GetUserAnswer(); this.GetUserAnswer();
}, },
methods: { methods: {

View File

@ -163,14 +163,16 @@ export default {
}, },
created() { created() {
this.dialogVisible = true; this.dialogVisible = true;
// let str = window.location.href.split("?")[1]; let str = window.location.href.split("?")[1];
// this.user_id = str.split("|")[0]; this.user_id = str.split("|")[0];
// let type = str.split("|")[1]; let type = str.split("|")[1];
// if (type == 1) { if (type == 1) {
// this.$store.commit("setType", "GYWZ_yx"); this.$store.commit("setType", "GYWZ_yx");
// } else { } else {
// this.$store.commit("setType", "GYWZ_wx"); this.$store.commit("setType", "GYWZ_wx");
// } }
alert(this.user_id, this.$store.state.type);
console.log(this.user_id, this.$store.state.type);
this.GetUserAnswer(); this.GetUserAnswer();
}, },
methods: { methods: {

View File

@ -278,13 +278,15 @@ export default {
} else { } else {
this.$store.commit("setType", "GYWZ_wx"); this.$store.commit("setType", "GYWZ_wx");
} }
alert(this.user_id, this.$store.state.type);
console.log(this.user_id, this.$store.state.type);
this.GetUserAnswer(); this.GetUserAnswer();
}, },
methods: { methods: {
addPolicy() { addPolicy() {
this.$router.push({ this.$router.push({
name: "addstrategy", name: "addstrategy",
query: { id: "USER202307301109254198" }, query: { id: this.user_id },
}); });
}, },
async del(index, a) { async del(index, a) {