How to get code? when Wechat scans the code to log in

I didn"t know how to get code
var url=encodeURI ("xxxxx")
window.location.href=" https://open.weixin.qq.com/co." + "appid=xxxxxxx&redirect_uri="+url+"&response_type=code&scope=snsapi_login&state=3d6be0a4035d839573b04816624a415e-sharpwechat_redirect";

after scanning the code, I will jump to the above url. How can I get the code before the jump

clipboard.png

how should this callback be written, and where can I get the code to request other parameters

Aug.19,2021

Wechat will redirect to your redirect_uri, and attach code to query
for example:

http://aa.bb.cc?code=xxxxxx

Hello, have you solved it? I encounter the same problem, is it convenient to tell the method?


how to get code before jumping

Menu