美文网首页
动态算随机数

动态算随机数

作者: _嘿嘿_ | 来源:发表于2018-09-10 14:13 被阅读0次

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

    相关文章

      网友评论

          本文标题:动态算随机数

          本文链接:https://www.haomeiwen.com/subject/dodsgftx.html