时间戳不对,开发者工具没有问题,但是审核的时候总是有问题?
微信版本号:7.0.6 基础库版本号:1.2.0 问题: 小程序调用后台接口,需要上传时间戳,格式类似于20190916181809Z,小程序代码如下: util.js [代码]var[代码] [代码]getTime = [代码][代码]function[代码][代码](){[代码][代码] [代码][代码]var[代码] [代码]date = [代码][代码]new[代码] [代码]Date;[代码][代码] [代码][代码]var[代码] [代码]year = date.getFullYear();[代码][代码] [代码][代码]var[代码] [代码]month = date.getMonth() + 1;[代码][代码] [代码][代码]if[代码][代码](month<10){[代码][代码] [代码][代码]month = [代码][代码]'0'[代码] [代码]+ month[代码][代码] [代码][代码]}[代码][代码] [代码][代码]var[代码] [代码]day = date.getDate();[代码][代码] [代码][代码]if[代码][代码](day<10){[代码][代码] [代码][代码]day = [代码][代码]'0'[代码][代码]+day;[代码][代码] [代码][代码]}[代码][代码] [代码][代码]var[代码] [代码]hour = date.getHours();[代码][代码] [代码][代码]if[代码][代码](hour<10){[代码][代码] [代码][代码]hour = [代码][代码]'0'[代码][代码]+hour[代码][代码] [代码][代码]}[代码][代码] [代码][代码]var[代码] [代码]minute = date.getMinutes();[代码][代码] [代码][代码]if[代码][代码](minute<10){[代码][代码] [代码][代码]minute = [代码][代码]'0'[代码] [代码]+ minute[代码][代码] [代码][代码]}[代码][代码] [代码][代码]var[代码] [代码]second = date.getSeconds();[代码][代码] [代码][代码]if[代码][代码](second<10){[代码][代码] [代码][代码]second = [代码][代码]'0'[代码] [代码]+ second[代码][代码] [代码][代码]}[代码][代码] [代码][代码]return[代码] [代码]year+[代码][代码]""[代码][代码]+month+[代码][代码]""[代码][代码]+day+[代码][代码]""[代码][代码]+hour+[代码][代码]""[代码][代码]+minute+[代码][代码]""[代码][代码]+second;[代码][代码]}[代码]httpClientHelper.js [代码]function[代码] [代码]request(method, [代码]bodyjson[代码], requestHandler) {[代码] [代码] [代码][代码]var[代码] [代码]common = require([代码][代码]"util.js"[代码][代码]);[代码][代码] [代码][代码]var[代码] [代码]tstamp = common.getTime() + [代码][代码]"Z"[代码][代码];[代码][代码][代码] var hurl = requestHandler.hurl; [代码] [代码][代码]wx.request({[代码][代码] [代码][代码]url: hurl,[代码][代码] [代码][代码]data: bodyjson,[代码][代码] [代码][代码]header: {[代码][代码] [代码][代码]'Content-type'[代码][代码]: [代码][代码]'application/json'[代码][代码], [代码][代码]// 默认值[代码][代码] [代码][代码]'timestamp'[代码][代码]: tstamp[代码][代码] [代码][代码]},[代码][代码] [代码][代码]method: [代码]method[代码], [代码][代码] [代码][代码]success: [代码][代码]function[代码] [代码](res) {[代码][代码] [代码][代码]requestHandler.success(res)[代码][代码] [代码][代码]},[代码][代码] [代码][代码]fail: [代码][代码]function[代码] [代码]() {[代码][代码] [代码][代码]requestHandler.fail()[代码][代码] [代码][代码]console.log([代码][代码]"wx.request fail"[代码][代码]);[代码][代码] [代码][代码]},[代码][代码] [代码][代码]complete: [代码][代码]function[代码] [代码]() {[代码][代码] [代码][代码]requestHandler.complete()[代码][代码] [代码][代码]console.log([代码][代码]'wx.request complete'[代码][代码]);[代码][代码] [代码][代码]}[代码][代码] [代码][代码]})[代码][代码]}[代码] 在开发者工具测试没问题,体验版也没问题,但是提交审核就总是通不过,看后台日志,审核的时候发出请求的timestamp是这样的:1568789996,实在搞不懂是哪里的问题,请大神帮忙看看,感谢! 唯一知道的是(1568789996 * 1000)其实就是20190916181809Z的毫秒值,所以我怀疑在什么地方(比如网关)把我的时间戳(20190916181809Z)给转换了一遍(1568789996)