前提是已经配置好了相应的外网和内网端口的映射 一.公网ip和端口配置 在vue项目启动之前对项目下:项目名/config/index.js 文件进行修改 原来的内容为:(位置在index.js的第16,17行作用) host: 'localhost', // can be overwritten by process.env.HOST port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free
//获取当前网址 var curWwwPath=window.document.location.href; alert(curWwwPath); //http://localhost:8080/Test/index.jsp //获取主机地址之后的目录 var pathName=window.document.location.pathname; alert(pathName); // /Test/index.jsp //获取主机地址 var pos=curWwwPath.indexO