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(){