vue devServer不生效原因

2019-08-02  本文已影响0人  naxxm

1.前端调用的api接口为匹配

proxy: { // 配置跨域
            '/api': {//为匹配到次过滤
                target: 'http://localhost:8081',
                ws: true,
                changOrigin: true,
                pathRewrite: {
                    '^/api': ''
                }
            }
}

2.接口服务器对应端口未启用

Proxy error: Could not proxy request /login from localhost:8080 to http://localhost:8081 (ECONNREFUSED).
上一篇 下一篇

猜你喜欢

热点阅读