h5微信鉴权地址传参数

我有个页面要在微信中打开
http://www.xxxx.com/index.html?a=1&b=2
再在做微信鉴权

window.loction.href="https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx520c15f417810387&redirect_uri=https%3A%2F%2Fwww.xxx.com%2Findex.html%3Fd%3D%26c%3DwxAdapter%26m%3DmobileDeal%26showwxpaytitle%3D1%26vb2ctag%3D4_2030_5_1194_60&response_type=code&scope=snsapi_base&state=123#wechat_redirect"

页面会重定向到http://www.xxxx.com/index.html?code=xxx&state=STATE

那我怎么拿到最初传的a和b的参数呢

请把你的相关参数追加到回调地址然后统一做urlencode