uploadFile.1891be8d.js 841 B

1
  1. var l=(s,n,a)=>new Promise((c,t)=>{var e=o=>{try{r(a.next(o))}catch(i){t(i)}},y=o=>{try{r(a.throw(o))}catch(i){t(i)}},r=o=>o.done?c(o.value):Promise.resolve(o.value).then(e,y);r((a=a.apply(s,n)).next())});import{g as d,a as g}from"./oss-file-upload.064bf654.js";const p="gyt",u="public-read",m=`https://${p}.ks3-cn-beijing.ksyuncs.com/`,k=s=>l(void 0,null,function*(){const n={filename:s,bucketName:p,postData:{filename:s,acl:u,key:s,unknowValueField:[]}},{data:a}=yield d(n);return console.log(a),a}),w=(s,n,a,c)=>l(void 0,null,function*(){const t={policy:s.policy,signature:s.signature,key:n,KSSAccessKeyId:s.kssAccessKeyId,acl:u,name:n,file:a};return yield g(m,t)}),A=(s,n)=>l(void 0,null,function*(){var e;const a=Date.now()+((e=s.name)==null?void 0:e.slice(s.name.lastIndexOf("."))),c=yield k(a);return yield w(c,a,s)});export{A as a};