怎么能上传多图到云存储?
用wx.cloud.uploadFile,
这个cloudPath 必须给一个图片的名称,怎么能让这个名称成为唯一的,这样才能找到图片。
谢谢
用时间+用户昵称当文件名字
var myDate = new Date();
var myYear = myDate.getYear();
var myMonth = myDate.getMonth();
var myHour = myDate.getHours();
var myMinute = myDate.getMinutes();
var mySecond = myDate.getSeconds();
console.log(app.globalData.userInfo)
var nickName = app.globalData.userInfo.nickName;
const cloudPath = ‘’ + myYear + myMonth + myHour + myMinute + mySecond + nickName + filePath.match(/\.[^.]+?$/)[0];