Commit fec8e5c1 authored by 罗超's avatar 罗超

优化上传缓存

parent 09aa6dc7
...@@ -19,8 +19,10 @@ class AliyunUpload { ...@@ -19,8 +19,10 @@ class AliyunUpload {
static UploadAsync = async (file:any,name:string)=>{ static UploadAsync = async (file:any,name:string)=>{
try { try {
const oss = this.GetOSS() const oss = this.GetOSS()
let result = await oss.put(name,file) const headers = {
console.log(result) 'Cache-Control':'public,max-age=31536000'
};
let result = await oss.put(name,file,{headers})
return 'https://im.oytour.com/'+name//result.url return 'https://im.oytour.com/'+name//result.url
} catch (error) { } catch (error) {
console.log('上传发生异常:',error) console.log('上传发生异常:',error)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment