From 82cf12f5a4c834b71ff00a500f68da4237df64b9 Mon Sep 17 00:00:00 2001 From: zhouxueli <2841188632@qq.com> Date: Wed, 23 Aug 2023 14:00:23 +0800 Subject: [PATCH] =?UTF-8?q?token=E9=97=AE=E9=A2=98=E4=BF=AE=E5=A4=8D6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/http.js | 4 ++-- src/views/index/vehicleAdd.vue | 6 +++--- src/views/index/vehicleManage.vue | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/utils/http.js b/src/utils/http.js index d05648ff..7d8d6b78 100644 --- a/src/utils/http.js +++ b/src/utils/http.js @@ -15,8 +15,8 @@ service.interceptors.request.use( config.data = config.contentType ? config.data : qs.stringify(config.data) config.headers['Content-Type'] = config.contentType || 'application/x-www-form-urlencoded' const urlParams = new URLSearchParams(window.location.search); - const tokenParams=this.$route.params?.token - const token = urlParams.get('token') || tokenParams; + // const tokenParams=this.$route.params?.token + const token = urlParams.get('token') ; // this.$toast("token" + token) // let token='eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJzemwiLCJhdWQiOlsic3VwcGxpZXItYXBwIl0sIm5iZiI6MTY5MjY4MDk1MywidXNlcl9pbmZvIjp7InVzZXJJZCI6NTQ1ODUsInBob25lIjoiMTc2MzAwMzU2NTgiLCJuYW1lIjoi5bCP5a6LIiwic3VwcGxpZXJOYW1lIjoi5LiK5rW35a6J55WFQSIsInN1cHBsaWVySWQiOjExMjgsInN1cHBsaWVyVHlwZSI6MSwidXNlcm5hbWUiOiJzemwiLCJ1c2VyVHlwZSI6IkFQUCIsImF1dGhvcml0aWVzIjpbXX0sInNjb3BlIjpbImFsbCJdLCJpc3MiOiJodHRwczovL3Npbm9hc3Npc3QuY29tIiwiZXhwIjoxNjkyNzY3MzUzLCJpYXQiOjE2OTI2ODA5NTN9.GClSyBkWX_LedBuO2h6xoBHyL3xsgFeGp_zirimAuTk' config.headers['Authorization'] = `${token}`; diff --git a/src/views/index/vehicleAdd.vue b/src/views/index/vehicleAdd.vue index 0a492b43..5fc5b64b 100644 --- a/src/views/index/vehicleAdd.vue +++ b/src/views/index/vehicleAdd.vue @@ -150,9 +150,9 @@ export default { } }, async mounted() { - const urlParams = new URLSearchParams(window.location.search); - const token = urlParams.get('token'); - this.$toast("车辆编辑打印token" + token) + // const urlParams = new URLSearchParams(window.location.search); + // const token = urlParams.get('token'); + // this.$toast("车辆编辑打印token" + token) this.id=this.$route.params?.id const selectElement = document.getElementById('mySelect'); selectElement.addEventListener('change', function() { diff --git a/src/views/index/vehicleManage.vue b/src/views/index/vehicleManage.vue index 9802614b..dda0e444 100644 --- a/src/views/index/vehicleManage.vue +++ b/src/views/index/vehicleManage.vue @@ -58,8 +58,8 @@ export default { } }, mounted() { - const urlParams = new URLSearchParams(window.location.search); - this.token = urlParams.get('token') + // const urlParams = new URLSearchParams(window.location.search); + // this.token = urlParams.get('token') this.$toast('window.location'+window.location) this.getVehicleList(); }, @@ -68,7 +68,7 @@ export default { this.$router.push({ name:'vehicleAdd', params:{ - token:this.token, + // token:this.token, id:item.vehicleId } })