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

Saber 已结 4 3819
南北
南北 2019-04-25 19:38

image.png

4条回答
  •  zhx1994
    zhx1994 (楼主)
    2019-04-26 16:39

        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

    }

    标红的设置下

提交回复