let url = require('url'); //一个url路径 let u = 'http://LiMing:xxxx@www.baidu.com:80/abc/index.html?a=1&b=2#hash'; let urlObj = url.parse(u); console.log(urlObj); 可以打印出 Url { protocol: 'http:', slashes: true, auth: 'LiMing:xxxx', host: 'www.baidu.com:80', port: '80', host...