前段项目提示跨域,后端已经设置可以跨域了。有人遇到过吗?

Saber 已结 4 3620
南北
南北 剑童 2019-04-25 19:38

image.png

4条回答
  •  admin
    admin (最佳回答者)
    2019-04-25 19:52

    如何启动的项目,为什么接口统一的api前缀也没了,你改了哪些

    1 讨论(5)
  • 2019-04-26 16:01

    只是来学习学习,支持

    0 讨论(0)
  •     env: require('./dev.env'),

        port: 8080,

        autoOpenBrowser: false,

        assetsSubDirectory: 'static',

        assetsPublicPath: '/',

        proxyTable: {

            '/api': {

                target: 'http://api.douban.com/v2',

                changeOrigin: true,

                pathRewrite: {

                    '^/api': ''

                }

            }

        },

        // CSS Sourcemaps off by default because relative paths are "buggy"

        // with this option, according to the CSS-Loader README

        // (https://github.com/webpack/css-loader#sourcemaps)

        // In our experience, they generally work as expected,

        // just be aware of this issue when enabling this option.

        cssSourceMap: false

    }

    标红的设置下

    0 讨论(0)
  • 2021-04-04 14:52

    设置了跨域还是请求本地地址啊!

    0 讨论(0)
提交回复