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

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e5a610-455a1.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e5a610-455a1.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?