"use strict";const e=require("../../../common/vendor.js"),o=require("../../config/index.js"),l={uploadFile:r=>(e.index.getStorageSync("token"),e.index.showLoading({title:"上传中"}),new Promise((t,a)=>{e.index.uploadFile({url:o.baseUrl+o.apiPath+"/infra/file/upload",filePath:r,name:"file",header:{Accept:"*/*","tenant-id":"1"},success:i=>{let n=JSON.parse(i.data);if(n.error===1)e.index.showToast({icon:"none",title:n.msg});else return t(n)},fail:i=>(console.log("上传失败:",i),t(!1)),complete:()=>{e.index.hideLoading()}})}))};exports.FileApi=l;