diff --git a/src/api/request.ts b/src/api/request.ts index 4704ea1b..8ca6f5fd 100644 --- a/src/api/request.ts +++ b/src/api/request.ts @@ -14,12 +14,17 @@ const service = axios.create({ }); const company = 'carsafe'; -const userId = $wujie?.props?.USER_ID || localStorage.getItem('USER_ID') || ''; -const token = $wujie?.props?.TOKEN || localStorage.getItem('TOKEN') || ''; -const tenantId = $wujie?.props?.TENANT_ID || localStorage.getItem('TENANT_ID') || ''; +let userId = $wujie?.props?.USER_ID || localStorage.getItem('USER_ID') || ''; +let token = $wujie?.props?.TOKEN || localStorage.getItem('TOKEN') || ''; +let tenantId = $wujie?.props?.TENANT_ID || localStorage.getItem('TENANT_ID') || ''; service.interceptors.request.use( (config) => { + if (config.params?.token) { + userId = config.params.userId; + token = config.params.token; + tenantId = config.params.tenantId; + } config.headers['company'] = company; config.headers['jobNumber'] = userId; config.headers['token'] = token; diff --git a/src/components/common/filePreview/index.vue b/src/components/common/filePreview/index.vue index bfafa18c..f612b72c 100644 --- a/src/components/common/filePreview/index.vue +++ b/src/components/common/filePreview/index.vue @@ -8,7 +8,7 @@