diff --git a/src/App.vue b/src/App.vue index 9bfc3092..e3c7cefc 100644 --- a/src/App.vue +++ b/src/App.vue @@ -10,11 +10,6 @@ diff --git a/src/views/index/driverAdd.vue b/src/views/index/driverAdd.vue index 27c3fd3c..e6327b88 100644 --- a/src/views/index/driverAdd.vue +++ b/src/views/index/driverAdd.vue @@ -86,6 +86,9 @@ export default { } }, mounted() { + const urlParams = new URLSearchParams(window.location.search); + const token = urlParams.get('token'); + this.$toast("司机编辑打印token",token) this.id = this.$route.params?.id; this.driverName = this.$route.params?.name; this.driverPhone = this.$route.params?.phone; @@ -137,7 +140,7 @@ export default { validatePhoneNumber() { const phoneNumberRegex = /^1[0-9]{10}$/; - if (phoneNumberRegex.test(this.driverPhone)) { + if (!phoneNumberRegex.test(this.driverPhone)) { this.phoneNumberError = true; this.phoneNumberErrorMessage = '电话号码格式不正确,请输入有效的11位手机号码。'; } else { diff --git a/src/views/index/driverManage.vue b/src/views/index/driverManage.vue index a2c1d7cf..764f391e 100644 --- a/src/views/index/driverManage.vue +++ b/src/views/index/driverManage.vue @@ -66,6 +66,9 @@ export default { } }, mounted() { + const urlParams = new URLSearchParams(window.location.search); + const token = urlParams.get('token'); + this.$toast("司机管理打印token",token) this.getDriverList() }, methods:{ diff --git a/src/views/index/vehicleAdd.vue b/src/views/index/vehicleAdd.vue index 87916581..e4b12862 100644 --- a/src/views/index/vehicleAdd.vue +++ b/src/views/index/vehicleAdd.vue @@ -150,6 +150,9 @@ export default { } }, async mounted() { + const urlParams = new URLSearchParams(window.location.search); + const token = urlParams.get('token'); + this.$toast("车辆编辑打印token",token) this.id=this.$route.query?.id || '' this.$toast('id:', this.id) const selectElement = document.getElementById('mySelect'); diff --git a/src/views/index/vehicleManage.vue b/src/views/index/vehicleManage.vue index 84587215..b5b93cdb 100644 --- a/src/views/index/vehicleManage.vue +++ b/src/views/index/vehicleManage.vue @@ -57,6 +57,9 @@ export default { } }, mounted() { + const urlParams = new URLSearchParams(window.location.search); + const token = urlParams.get('token'); + this.$toast("车辆管理打印token",token) this.getVehicleList(); }, methods:{