Giter Club home page Giter Club logo

Comments (20)

lishan-ls avatar lishan-ls commented on June 15, 2024 2

通过fetch访问子项目,需要子项目进行可跨域配置,vue.config.js:

devServer: {
headers: {
'Access-Control-Allow-Origin': '*'
}
}

from vue-cli-plugin-qiankun.

F-loat avatar F-loat commented on June 15, 2024

子项目启动时端口号有变吗,主项目开发时是依赖端口号的

from vue-cli-plugin-qiankun.

mokedeng avatar mokedeng commented on June 15, 2024

没变,直接把代码拉下来后运行那4句,就报错了。在win7和win10都试了,报错信息一致

from vue-cli-plugin-qiankun.

F-loat avatar F-loat commented on June 15, 2024

yarn serve:all 后单独访问 8081 和 8082 都是好的吗

from vue-cli-plugin-qiankun.

mokedeng avatar mokedeng commented on June 15, 2024

单独访问8081和8082是ok的,不能在主页面切换foo-app

from vue-cli-plugin-qiankun.

F-loat avatar F-loat commented on June 15, 2024

我这儿 mac 没问题,晚上回去用 win 再试下看看,之前应该也都是好的

from vue-cli-plugin-qiankun.

F-loat avatar F-loat commented on June 15, 2024

还是没复现,你看下主应用加载 foo-app 的请求成功了没,返回的结果是啥

from vue-cli-plugin-qiankun.

mokedeng avatar mokedeng commented on June 15, 2024

from vue-cli-plugin-qiankun.

F-loat avatar F-loat commented on June 15, 2024

看眼网络请求的结果

from vue-cli-plugin-qiankun.

huangfushengkun avatar huangfushengkun commented on June 15, 2024

解决了吗?

from vue-cli-plugin-qiankun.

CIGE-Vince avatar CIGE-Vince commented on June 15, 2024

配置了
headers: {
'Access-Control-Allow-Origin': '*'
}
还是不行
Uploading image.png…

from vue-cli-plugin-qiankun.

CIGE-Vince avatar CIGE-Vince commented on June 15, 2024

Failed to load http://localhost:8081/: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

from vue-cli-plugin-qiankun.

lishan-ls avatar lishan-ls commented on June 15, 2024

Failed to load http://localhost:8081/: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

配置完后重启子项目

from vue-cli-plugin-qiankun.

jtbss avatar jtbss commented on June 15, 2024

使用 localhost

from vue-cli-plugin-qiankun.

YY0908 avatar YY0908 commented on June 15, 2024

遇到同样的问题,请问解决了吗?

from vue-cli-plugin-qiankun.

puchunjie avatar puchunjie commented on June 15, 2024

有后续么?同样的问题 愁死了

from vue-cli-plugin-qiankun.

imberZsk avatar imberZsk commented on June 15, 2024

from vue-cli-plugin-qiankun.

lifeblood123 avatar lifeblood123 commented on June 15, 2024

有解决吗

from vue-cli-plugin-qiankun.

zhaoying-zoe avatar zhaoying-zoe commented on June 15, 2024

same here

from vue-cli-plugin-qiankun.

toSeeWorld avatar toSeeWorld commented on June 15, 2024

通过fetch访问子项目,需要子项目进行可跨域配置,vue.config.js:

devServer: { headers: { 'Access-Control-Allow-Origin': '*' } }

感谢,修改子应用的webpack后重启项目,成功解决

from vue-cli-plugin-qiankun.

Related Issues (14)

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.