美文网首页
vue devServer不生效原因

vue devServer不生效原因

作者: naxxm | 来源:发表于2019-08-02 09:23 被阅读0次

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).

相关文章

网友评论

      本文标题:vue devServer不生效原因

      本文链接:https://www.haomeiwen.com/subject/sqjkdctx.html