The signed string is {code...}. The url contains ", for example, urlmp.weixin.qq.com? Paramsvalue (no "") urlmp.weixin.qq.com? Paramsvalue (with "") will cause "invalidurldomain" error. Why? The signed string is:
jsapi_ticket=sM4AOVdWfPE4DxkXGEs8VMCPGGVi4C3VM0P37wVUCFvkVAy_90u5h9nbSlYy3-Sl-HhTdfl2fzFy1AOcHKP7qg&noncestr=Wm3WZYTPz0wzccnW×tamp=1414587457&url=http://mp.weixin.qq.com?params=value
The url contains "/", for example:
Url = http://mp.weixin.qq.com? Params = value (no "/")
Url = http://mp.weixin.qq.com /? Params = value (with "/")
This will cause the "invalid url domain" error. Why?
Reply content:
The signed string is:
jsapi_ticket=sM4AOVdWfPE4DxkXGEs8VMCPGGVi4C3VM0P37wVUCFvkVAy_90u5h9nbSlYy3-Sl-HhTdfl2fzFy1AOcHKP7qg&noncestr=Wm3WZYTPz0wzccnW×tamp=1414587457&url=http://mp.weixin.qq.com?params=value
The url contains "/", for example:
Url = http://mp.weixin.qq.com? Params = value (no "/")
Url = http://mp.weixin.qq.com /? Params = value (with "/")
This will cause the "invalid url domain" error. Why?
Is this a problem?
'/' Will lead to incomplete parameters in the url you pass. The url received by the sdk does not match your actual url. Of course, it will be invalid domain.
This is related to the method that your front-end submits the url to the interface. Simply put, the url encode can be avoided. Some libraries such as jQuery or Zepto may encapsulate the encode step in ajax. If you write native ajax, you may miss the encode, resulting in incomplete parameter transmission.