From e3bdcf4bb78ce00fbe4dcc8780974b978998ddc0 Mon Sep 17 00:00:00 2001 From: dingtalk_umvbsp Date: Sun, 15 Jan 2023 11:02:43 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9C=B0=E5=9D=97=E5=9F=BA=E6=9C=AC=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=20=E8=81=94=E8=B0=83=E4=BF=9D=E5=AD=98=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/request.js | 7 +++--- components/form.vue | 18 ++++++-------- pages/massif/info.vue | 57 +++++++++++++++++++++++++++++++++---------- 3 files changed, 55 insertions(+), 27 deletions(-) diff --git a/common/request.js b/common/request.js index b56a794..62b81ef 100644 --- a/common/request.js +++ b/common/request.js @@ -3,7 +3,7 @@ import store from "@/store" export function host(host='default',suffix='/plant_manage'){ return( process.env.NODE_ENV === 'development'?{ - default:`http://qv6mj8.natappfree.cc${suffix}` + default:`http://m3df6f.natappfree.cc${suffix}` }:{ default:`http://qv6mj8.natappfree.cc${suffix}` } @@ -29,10 +29,11 @@ const request=async function(url,param={}){ "X-Access-Token":store.getters.token, } - if(param.file){ + if(param.file||param.filePath){ var res=await uni.uploadFile({ url:`${param.host||host()}${('/'+url).replace(/\/{2}/,'/').replace(/\?.+/,"")}?${pathData}`, - file:param.file, + file:param.file||{}, + filePath:param.filePath||"", name:"file", formData:param.body||{}, timeout:param.timeout||60*1000, diff --git a/components/form.vue b/components/form.vue index 250deb0..b297672 100644 --- a/components/form.vue +++ b/components/form.vue @@ -141,25 +141,25 @@ - + {{suffix}} - {{/^\d+$/.test(value)&&columns[0][value][keyName]||placeholder||`请选择${label}`}} + {{/^\d+$/.test(value)&&columns[0][value].label||placeholder||`请选择${label}`}} 添加照片 -