Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

无界目前是否可以应用在生产级别的环境中 #61

Open
Old-ear opened this issue Aug 15, 2022 · 7 comments
Open

无界目前是否可以应用在生产级别的环境中 #61

Old-ear opened this issue Aug 15, 2022 · 7 comments

Comments

@Old-ear
Copy link

Old-ear commented Aug 15, 2022

当前在做微前端框架选择,项目本身是vue2做主,ng1 ng2 vue2都有子,之前调研过qiankun,对于ng和ng1有一些不太友好的地方,恰巧这时候看到了无界,但是目前看下来好像没有什么具体产品验证,特此询问一下(没有别的意思,就是单纯问一下测试及验证的情况)

@yiludege
Copy link
Collaborator

yiludege commented Aug 15, 2022

对于 vue 和 react 我们内部有大量的项目验证,包括h5都有上线的项目,但是对于 angular 确实没有经过大量验证

不过无界的适配成本非常低,如果子应用允许跨域,你可以简单的<wujie-vue name="xxx", url="xxxx"></wujie-vue>就可以验证项目是否OK了

@zhuxiaoweb
Copy link

对于 vue 和 react 我们内部有大量的项目验证,包括h5都有上线的项目,但是对于 angular 确实没有经过大量验证

不过无界的适配成本非常低,如果子应用允许跨域,你可以简单的<wujie-vue name="xxx", url="xxxx"></wujie-vue>就可以验证项目是否OK了

请问wujie里子应用发xhr请求跨域,子应用的nginx接口反向代理怎么配置?
Access to XMLHttpRequest at 'http://192.168.160.75:810/api/uac/user/page?pageNum=1&_t=1675143176347' from origin 'http://192.168.160.75:878' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.

@5265liu
Copy link

5265liu commented Apr 25, 2023

我们nginx配置好了跨域,还是一直报跨域错误,最终还是改回iframe了

@LeonIsACoder
Copy link

我们nginx配置好了跨域,还是一直报跨域错误,最终还是改回iframe了

这个问题不会无解吧,我现在也是本地好了,测试环境xhr请求一直报跨域错误,nginx什么都配了跨域的设置

@hqzh
Copy link

hqzh commented Jun 9, 2023

已上生产,稳的一批

@fcyao
Copy link

fcyao commented Jul 13, 2023

我们nginx配置好了跨域,还是一直报跨域错误,最终还是改回iframe了

这个问题不会无解吧,我现在也是本地好了,测试环境xhr请求一直报跨域错误,nginx什么都配了跨域的设置

我也是本地ok 测试线nginx配置好报跨域 这个能解决吗。
root html;
index index.html index.htm;
add_header Access-Control-Allow-Origin ;
add_header Access-Control-Allow-Methods GET,POST,OPTIONS,PUT,DELETE,FETCH;
add_header Access-Control-Allow-Credentials true;
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Max-Age' 1728000;
add_header 'Content-Type' 'text/plain; charset=utf-8';
add_header 'Content-Length' 0;
add_header 'Access-Control-Allow-Origin' $http_origin;
add_header 'Access-Control-Allow-Credentials' 'true';
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
add_header 'Access-Control-Allow-Headers' '
';
return 204;
}

上面跨域错误解决了 options 配到proxy里解决的, 新的问题是:主应用请求子应用接口的时候携带不上token信息

@yuanjianhua
Copy link

我们nginx配置好了跨域,还是一直报跨域错误,最终还是改回iframe了

这个问题不会无解吧,我现在也是本地好了,测试环境xhr请求一直报跨域错误,nginx什么都配了跨域的设置

我也是本地ok 测试线nginx配置好报跨域 这个能解决吗。 root html; index index.html index.htm; add_header Access-Control-Allow-Origin ; add_header Access-Control-Allow-Methods GET,POST,OPTIONS,PUT,DELETE,FETCH; add_header Access-Control-Allow-Credentials true; if ($request_method = 'OPTIONS') { add_header 'Access-Control-Max-Age' 1728000; add_header 'Content-Type' 'text/plain; charset=utf-8'; add_header 'Content-Length' 0; add_header 'Access-Control-Allow-Origin' $http_origin; add_header 'Access-Control-Allow-Credentials' 'true'; add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS'; add_header 'Access-Control-Allow-Headers' ''; return 204; }

上面跨域错误解决了 options 配到proxy里解决的, 新的问题是:主应用请求子应用接口的时候携带不上token信息

看看这个,是否能解决
https://www.cnblogs.com/testlearn/p/17311664.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants