动态算随机数

function commentServerTimestamp() {
// call from server or local time. But must return promise with UNIX Epoch timestamp resolved (like 1507617041)
return new Promise((resolve, reject) => {
let currentTimestamp = Math.round((new Date()).getTime() / 1000);
resolve(currentTimestamp);
});
}

options.commentTimestamp().then(utcSeconds => {
data.commentId = 'ql-comment-'+options.commentAuthorId+'-'+utcSeconds;
data.comment = comment;
// UNIX epoch like 1234567890
});

你可能感兴趣的:(动态算随机数)