javascript - 用js获取微信access_token,请教各位大神。
PHP中文网
PHP中文网 2017-04-11 11:02:12
0
2
208

我用get方式获取 控制台出现Uncaught SyntaxError: Unexpected token :
并且走到error,输出Object {readyState: 4, status: 200, statusText: "load"}

$.ajax({ url:'https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=appid&secret=secret', type:"get", dataType:"jsonp", async: true, success: function (result) { }, error: function (result) { console.log(result); } });
PHP中文网
PHP中文网

认证0级讲师

全員に返信 (2)
小葫芦

后台获取,

secret直接暴露出来,你确定要这样吗???

いいねを押す+0
    刘奇

    试试

    fetch('https://api.weixin.qq.com/cgi-bin/message/custom/send?access_token=123',{mode:'no-cors'})
    いいねを押す+0
      最新のダウンロード
      詳細>
      ウェブエフェクト
      公式サイト
      サイト素材
      フロントエンドテンプレート
      私たちについて 免責事項 Sitemap
      PHP中国語ウェブサイト:福祉オンライン PHP トレーニング,PHP 学習者の迅速な成長を支援します!