From 29ef4d4ada6e59b7c88a9667e610fb254540ab5c Mon Sep 17 00:00:00 2001 From: dingtalk_umvbsp Date: Sat, 14 Jan 2023 10:01:18 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=9B=BE=E7=89=87=E4=B8=8A?= =?UTF-8?q?=E4=BC=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/request.js | 5 +++-- components/form.vue | 6 +++++- pages/massif/index.vue | 1 + 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/common/request.js b/common/request.js index aa8c9e0..8da988c 100644 --- a/common/request.js +++ b/common/request.js @@ -3,7 +3,7 @@ import store from "@/store" function host(host='default'){ return( process.env.NODE_ENV === 'development'?{ - default:"http://vpep38.natappfree.cc/plant_manage" + default:"http://tishia.natappfree.cc/plant_manage" }:{ default:"http://vtm3hk.natappfree.cc/plant_manage" } @@ -33,7 +33,8 @@ const request=async function(url,param={}){ var res=await uni.uploadFile({ url:`${param.host||host()}${('/'+url).replace(/\/{2}/,'/').replace(/\?.+/,"")}?${pathData}`, files:param.file, - name:"file", + // name:"file", + formData:param.body||{}, timeout:param.timeout||60*1000, header, }).then(data=>({...data[1],data:JSON.parse(data[1].data)})) diff --git a/components/form.vue b/components/form.vue index 44c88ec..e99ad1b 100644 --- a/components/form.vue +++ b/components/form.vue @@ -265,8 +265,12 @@ import request from '@/common/request' sizeType:['compressed'], }) if(/ok/.test(res[1].errMsg)){ + console.log(res[1].tempFiles.map(v=>v.name),'---asfd-----') var upImg=await request("/sys/common/uploadBatch",{ - file:res[1].tempFiles//.map(v=>({...v,name:'file'})), + file:res[1].tempFiles, + body:{ + name:res[1].tempFiles.map(v=>v.name) + } }) console.log(upImg,"-----333333------------") }else{ diff --git a/pages/massif/index.vue b/pages/massif/index.vue index 31ce817..d86a21d 100644 --- a/pages/massif/index.vue +++ b/pages/massif/index.vue @@ -120,6 +120,7 @@ import request from '@/common/request' }, onLoad(){ this.search() + console.log(new FormData()) }, methods:{ clean(){