微信/ios/safira开发遇到的坑

前端之家收集整理的这篇文章主要介绍了微信/ios/safira开发遇到的坑前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

微信ios/Safari中的new Date()格式化坑

解决:在日期和时间中间加个"T",如:
```javascript
const Time = new Date('2017-03-08 00:00:00');   //ios中starTime为NaN

cosnt Time2 = new Date('2017-03-08T00:00:00'); //日期和时间中间加个T,兼容ios


[参考1:][https://www.jianshu.com/p/4ea9376839e0]
[参考2:][http://blog.csdn.net/pkueecser/article/details/53140999]
</code></pre>
<h3>Android端微信授权认证<a href="/tag/tiaozhuan/" target="_blank" class="keywords">跳转</a>不回来</h3>
<pre><code><a href="/tag/jiejue/" target="_blank" class="keywords">解决</a>:在传给<a href="/tag/houtai/" target="_blank" class="keywords">后台</a>的backUrl后面加个<a href="/tag/suiji/" target="_blank" class="keywords">随机</a>参数
如:
```javascript
axios.get('/wechat/authorize',{params: {backUrl: window.location.href + '?ran=' + Math.random()}}).then(res => {
        if (!res.data.data.authed) {
          window.location.href = res.data.data.url;
        }
      });
      ```</code></pre>

猜你在找的程序笔记相关文章