迷茫2017-06-22 11:54:16 0 2 313
如果我一个页面、有两个地方上传图片但是我想他们的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会相同呢
欧阳克 2017-06-22 11:56:162楼
key不同是指?
赞 +0添加回复
伊谢尔伦 2017-06-22 11:56:161楼
知道了,原来需要实例化
赞 +0添加回复