VUE2跨域

devServer: {
        open: false,        //启动项目后打开浏览器
        host: 'localhost',  //IP
        port: 3000,         //端口
        https: false,
        proxy: {
            '/api': {
                target: 'http://localhost:80',   //真实地址
                ws: false,   //websocket
                changeOrigin: true,             //跨域
                rewrite: (path) => path.replace(/^\/api/, '/api')
            }
        }
    }
posted @ 2022-08-08 09:03  七月的枫丶  阅读(280)  评论(0编辑  收藏  举报