Comments (7)
对于 vue 和 react 我们内部有大量的项目验证,包括h5都有上线的项目,但是对于 angular 确实没有经过大量验证
不过无界的适配成本非常低,如果子应用允许跨域,你可以简单的<wujie-vue name="xxx", url="xxxx"></wujie-vue>
就可以验证项目是否OK了
from wujie.
对于 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.
我们nginx配置好了跨域,还是一直报跨域错误,最终还是改回iframe了
from wujie.
我们nginx配置好了跨域,还是一直报跨域错误,最终还是改回iframe了
这个问题不会无解吧,我现在也是本地好了,测试环境xhr请求一直报跨域错误,nginx什么都配了跨域的设置
from wujie.
已上生产,稳的一批
from wujie.
我们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.
我们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)
- 子应用使用CKEditor5富文本编辑器,改变url的query参数重新加载后光标异常 HOT 13
- 子应用的全局变量没有被处理,导致其他脚本中读取全局变量报变量未定义的错误 HOT 2
- 页面中使用多个子应用时,子应用 getSelection() 指向错误 HOT 5
- ![image](https://user-images.githubusercontent.com/24648945/217492767-dcaed8cc-5686-4c60-806e-44d888b501b8.png)
- 子应用嵌套iframe ,iframe内部的 window.parent 指向到了主应用,并非子应用。 HOT 1
- 【功能建议】考虑使用 writable-dom 以浏览器更加标准的方式支持 dom 解析,并加快速度
- 无法进行子应用生命周期改造的情况下,有没有什么方法可以判断wujie加载状态,如果加载失败怎样获取加载失败事件?
- 监听resize 事件的时候 子应用的window.innerHeight window.innerWidth 没有变化 HOT 2
- wujie下spreadjs的自动化问题
- 子应用图片路径解析错误
- 子应用图片路径解析错误
- 子应用image标签使用相对路径,挂在到主应用后默认拼接主应用的域名
- url 进行encode后 ,访问404
- 【文档问题】快速上手无法上手,创建项目建不成功
- 当子应用的head中存在script引入且未设置defer、async时,子应用无法打开
- 部署子应用时加载错误
- 在无界中导航栏是父应用的的内容是子应用
- 单例模式下,来回切换子应用,子应用样式丢失
- 接入子应用后会报 Access-Control-Allow-Origin' header contains multiple values '*, *, *', but only one is allowed HOT 4
- 在火狐浏览器70版本下 @antv/g2plot不会生成图表,单独打开可以生成
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wujie.