chenying2100 1 hónapja
szülő
commit
b9cb05f6b1

+ 1 - 1
src/utils/request.ts

@@ -27,7 +27,7 @@ axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8';
 axios.defaults.headers['clientid'] = import.meta.env.VITE_APP_CLIENT_ID;
 // 创建 axios 实例
 const service = axios.create({
-  baseURL: 'http://192.168.1.237/dev-api',
+  baseURL: import.meta.env.VITE_APP_BASE_API, // api 的 base_url,
   timeout: 50000
 });
 

+ 4 - 1
src/views/patients/enteralNutrition/components/table/MaterialTable.vue

@@ -178,7 +178,8 @@ const changeConsumableSelect = async (id: string) => {
 watch(
   () => prop.modelValue,
   async (val: string) => {
-    let configData=JSON.parse(val);
+    if(val&&val.trim().length>0){
+      let configData=JSON.parse(val);
     const tableData = ref<TableRow[]>([]);
 
     configData.forEach((item:any) => { 
@@ -192,6 +193,8 @@ watch(
 
       tableData.value.push(row);
     });
+    }
+    
     console.log(configData, "?????*************????????????????");
   },
   { deep: true, immediate: true }

+ 1 - 1
vite.config.ts

@@ -31,7 +31,7 @@ export default defineConfig(({mode, command}) => {
           target: 'http://localhost:8081',
           changeOrigin: true,
           ws: true,
-          rewrite: (path) => path.replace(/^\/dev-api/, '')
+          rewrite: (path) => path.replace(new RegExp('^' + env.VITE_APP_BASE_API), '')
         }
       }
     },