ayuanshuai929's recent timeline updates
ayuanshuai929

ayuanshuai929

V2EX member #170774, joined on 2016-04-26 22:35:28 +08:00
ayuanshuai929's recent replies
然而最简单的流程是
1.点进你的 H5 页面入口
2.你的页面引导(其实就是跳转)用户访问微信的获取授权 code 页面(带有 redirect_url 参数)
3.微信的授权页面会回跳到一个你给的 URL 参数上并且带有授权 code
4.你通过授权 code 获得用户的 Openid
我记得用 ajax 取返回值的话,如果 PHP 加一个 header("Content-type:application/json")的话,回调的结果就是一个 json 对象,否则就是一个 string
md5(time())算不算,但是不能保证永不重复,只能说重复的概率非常小
可以在 JS 里写 PHP 代码,不过我觉得楼上说的 ajax 比较好
About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3274 Online   Highest 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 15ms · UTC 12:27 · PVG 20:27 · LAX 05:27 · JFK 08:27
♥ Do have faith in what you're doing.