Parcourir la source

iot打包问题解决

“hanlingqiang il y a 1 an
Parent
commit
5c6e25cb69
3 fichiers modifiés avec 5 ajouts et 4 suppressions
  1. 3 1
      src/api/home.ts
  2. 1 2
      src/utils/request.ts
  3. 1 1
      src/views/index.vue

+ 3 - 1
src/api/home.ts

@@ -55,6 +55,8 @@ export const customerApi = (params) => {
     url: Api.customerApi,
     method: 'get',
     params,
-    type: 'health',
+    headers: {
+      type: 'health',
+    },
   })
 }

+ 1 - 2
src/utils/request.ts

@@ -29,8 +29,7 @@ service.interceptors.request.use(
   (config: InternalAxiosRequestConfig) => {
     // 对应国际化资源文件后缀
     config.headers['Content-Language'] = getLanguage()
-
-    if (config.type === 'health') {
+    if (config.headers['type'] === 'health') {
       config.baseURL = import.meta.env.VITE_APP_HEALTH_API
     } else {
       config.baseURL = import.meta.env.VITE_APP_BASE_API

+ 1 - 1
src/views/index.vue

@@ -460,7 +460,7 @@ const jumpweb = async (type: any) => {
         let customerData = await customerApiF(md5Txt)
         if(customerData['status'] == 0) {
             // https://web.poteviohealth.com/r/daping/health/index.html?customerId=160
-            window.open(`https://web.poteviohealth.com/r/daping/health/index.html?customerId=${customerData.customerId}`,'_blank')
+            window.open(`https://web.poteviohealth.com/r/daping/health/index.html?customerId=${customerData['customerId']}`,'_blank')
         }else {
             ElMessage.error('跳转出错:'+ JSON.stringify(customerData))
         }