亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

javascript - Problem with Qiniu uploading pictures
迷茫
迷茫 2017-06-22 11:54:16
0
2
760

If I upload images in two places on a page but I think their keys are different, how can I separate them without conflict? My current approach is to create two files

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;
        },
    })
})

But why will the keys be the same if we do this?

迷茫
迷茫

業(yè)精于勤,荒于嬉;行成于思,毀于隨。

reply all(2)
學(xué)霸

What do you mean by different keys?

伊謝爾倫

I know, it turns out that it needs to be instantiated

var Qiniu1 = new QiniuJsSDK()
var Qiniu2 = new QiniuJsSDK()
var uploader1= Qiniu1 .uploader({})
var uploader2= Qiniu2 .uploader({})
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template