|
@@ -34,16 +34,20 @@ const mountMicroApp = (path, toPath?) => {
|
|
|
if (toPath) {
|
|
|
app['props']['data']['publicPath'] = toPath;
|
|
|
}
|
|
|
- debugger;
|
|
|
activeApps[app['activeRule']] = loadMicroApp(app, {
|
|
|
fetch(url, ...args) {
|
|
|
- return window.fetch(url, {
|
|
|
- ...args,
|
|
|
- headers: {
|
|
|
- 'Access-Control-Allow-Origin': '*',
|
|
|
- 'Content-Type': 'text/html',
|
|
|
- },
|
|
|
- });
|
|
|
+ // 给指定的微应用 entry 开启跨域请求
|
|
|
+ if (url === 'http://1.1.1.3:89/cookie/flash.js') {
|
|
|
+ return window.fetch(url, {
|
|
|
+ ...args,
|
|
|
+ headers: {
|
|
|
+ 'Access-Control-Allow-Origin': '*',
|
|
|
+ },
|
|
|
+ mode: 'cors',
|
|
|
+ credentials: 'include',
|
|
|
+ });
|
|
|
+ }
|
|
|
+ return window.fetch(url, ...args);
|
|
|
},
|
|
|
}); // 手动加载子应用
|
|
|
}
|