vue 代理连接配置

来源:互联网 发布:如何屏蔽淘宝短信 编辑:程序博客网 时间:2024/06/11 01:29
  1. 打开config文件夹写index.js

    这里写图片描述

    1. index.js里面
dev  : {        env               : require('./dev.env'),        port              : 8080,        autoOpenBrowser   : true,        assetsSubDirectory: 'static',        assetsPublicPath  : '/',        proxyTable        : {            '/api'  : {                target      : 'http://192.168.1.101:8080',                changeOrigin: true,                pathRewrite : {                    '^/api': '/api'                }            },       }

设置端口和后台连接地址