You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2 lines
556 B

"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;