From 5ab689430d1b194cf3894a90d8012ed8aa1839bb Mon Sep 17 00:00:00 2001 From: zhouxueli <2841188632@qq.com> Date: Wed, 23 Aug 2023 11:40:47 +0800 Subject: [PATCH] =?UTF-8?q?token=E9=97=AE=E9=A2=98=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.vue | 5 ----- src/views/index/driverAdd.vue | 5 ++++- src/views/index/driverManage.vue | 3 +++ src/views/index/vehicleAdd.vue | 3 +++ src/views/index/vehicleManage.vue | 3 +++ 5 files changed, 13 insertions(+), 6 deletions(-) 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:{