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

qiankun微前端 子应用调用fetch 后,fetch this指向错误导致一直pending #556

Closed
edifierx666 opened this issue Aug 5, 2022 · 0 comments
Labels

Comments

@edifierx666
Copy link

vConsole Version:3.14.6
qiankun: 2.7.3
webpack: 5.x
vue: 2.6.14
复现手机iphone 13pro max
ios:15.6
此bug只在移动端出现

return (<ReturnType<T>>target.apply(thisArg, argsList)).then(this.afterFetch(item)).catch((e) => {

因为qiankun子应用调用window的方法会用代理的对象:window.proxy
在子应用里调用fetch这里的thisArg就会变成window.proxy
打印 thisArg===window.proxy 结果为true
这里修改源码吧thisArg改为window就可以了

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

No branches or pull requests

2 participants