About how to deal with cross-domain issues in Wechat verification in the egg front-end separation project

the project is separated from the front and rear ends, and the front paragraph is packaged into a x.html static file, combined with x.cssjournal x.js

many configurations of egg have been completed, and cross-domain access is successful. Com/x.html-sharp/user can successfully obtain data
problem. Wechat verification requires backend redirection
example this.ctx.redirect ("https://open.weixin.qq.com/connect/oauth2/authorize?appid="+AppID+"&redirect_uri="+return_uri+"&response_type=code&scope="+scope+"&state=STATE-sharpwechat_redirect");
the parameter of this return_uri is .com / oauth, then the front-end page visits the url will prompt the cross-domain

XMLHttpRequest cannot load https://open.weixin.qq.com/connect/oauth2/authorize?appid=xxxxxx&redirect_uri=xxxxxxx&response_type=code&scope=snsapi_userinfo&state=STATE-sharpwechat_redirect. Redirect from "https://open.weixin.qq.com/connect/oauth2/authorize?appid=xxxxxx&redirect_uri=xxxxxxxxx&response_type=code&scope=snsapi_userinfo&state=STATE-sharpwechat_redirect" to "https://open.weixin.qq.com/connect/oauth2/authorize?appid=xxxxxx&redirect_uri=xxxxxxx&response_type=code&scope=snsapi_userinfo&state=STATE&connect_redirect=1-sharpwechat_redirect" has been blocked by CORS policy: No "Access-Control-Allow-Origin" header is present on the requested resource. Origin "xxxxxxxx" is therefore not allowed access.


axios

Menu