Git Product home page Git Product logo

Comments (7)

yiludege avatar yiludege commented on June 27, 2024 4

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

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

from wujie.

zhuxiaoweb avatar zhuxiaoweb commented on June 27, 2024 1

对于 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.

from wujie.

5265liu avatar 5265liu commented on June 27, 2024

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

from wujie.

LeonIsACoder avatar LeonIsACoder commented on June 27, 2024

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

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

from wujie.

hqzh avatar hqzh commented on June 27, 2024

已上生产,稳的一批

from wujie.

fcyao avatar fcyao commented on June 27, 2024

我们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信息

from wujie.

yuanjianhua avatar yuanjianhua commented on June 27, 2024

我们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

from wujie.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.