如果我一个页面、有两个地方上传图片但是我想他们的key不同,要怎么才能分开不冲突呢,我现在的做法是创建两个文件
var uploader1= Qiniu.uploader({
'Key': function(up, file) {
var now = new Date();
var date = now.getFullYear()+((now.getMonth()+1)<10?"0":"")+(now.getMonth()+1)+(now.getDate()<10?"0":"")+now.getDate();
return "topic/cover/"+date;
},
})
var uploader2= Qiniu.uploader({
'Key': function(up, file) {
var now = new Date();
var date = now.getFullYear()+((now.getMonth()+1)<10?"0":"")+(now.getMonth()+1)+(now.getDate()<10?"0":"")+now.getDate();
return "topic/banner/"+date;
},
})
})
但是这样做为什么key会相同呢
key不同是指?
知道了,原来需要实例化