$api = "https://mp.weixin.qq.com/cgi-bin/componentloginpage?component_appid=xxx&pre_auth_code=xxx&redirect_uri=xxx&auth_type=xxx";
is not allowed to directly access the API generated above, it must be the source URL, and the source URL must be the same as the one set in the third party platform.