Commit fec8e5c1 authored by 罗超's avatar 罗超

优化上传缓存

parent 09aa6dc7
......@@ -19,8 +19,10 @@ class AliyunUpload {
static UploadAsync = async (file:any,name:string)=>{
try {
const oss = this.GetOSS()
let result = await oss.put(name,file)
console.log(result)
const headers = {
'Cache-Control':'public,max-age=31536000'
};
let result = await oss.put(name,file,{headers})
return 'https://im.oytour.com/'+name//result.url
} catch (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