vue project, use Wechat"s third-party website to scan the code to log in, according to the official document
-
first step
var obj = new WxLogin({ self_redirect:true, id:"login_container", appid: "", scope: "", redirect_uri: "", // state: "", style: "", href: "" });
-
the second step is to get the interface of access_token through the address + code redirected in the previous step.
http: GET https://api.weixin.qq.com/sns/oauth2/access_token?appid=APPID&secret=SECRET&code=CODE&grant_type=authorization_code
what I don"t understand is that Wechat"s code-scanning authentication page does not have a specified callback function to accept the return of the backend, so how to obtain the backend-related data and token and return it to the vue page is directly redirected to the frontend page (url with parameters)?