// 判断是否为内网网访问 var isWeb = location.hostname.indexOf("192.168")>-1; //是否为生产环境 const webUrl = location.href.indexOf("/web") > -1 ? "/web" : ""; var host = isWeb?location.hostname:""; var port = isWeb? location.port:""; var url = "http://"+host+":"+port+webUrl; console.log(host); const config = { //本地html文件路径 htmUlr:url, // FileJS jsUrl:url+'data/fileTree.js' } console.log(config.htmUlr);