摘自:http://www.tuicool.com/articles/y2InYrV
微信開發通過網頁授權獲取用戶基本信息時,可能會需要一些參數,通過驗證redirect_url中的參數只能放置一個,例如:
https://open.weixin.qq.com/connect/oauth2/authorize?appid=appid&
redirect_uri=http://ip:port/app/method?appid=1&appType=service
&response_type=code&scope=snsapi_base&state=123#wechat_redirect
此時appType=service這個參數是沒有的,微信平台給處理掉了
想到了一種解決辦法,組織參數為json字符串,例如
param={"appid":1,"appType":"service"}
注意,參數必須進行編碼才可行
通過這種方式,就可以在redirect_url中添加多個參數了
