1.获取当前窗口完整的url地址
window.location.href // 'https://ant.design/components/button-cn'
document.URL // 'https://ant.design/components/button-cn'
self.location.href // 'https://ant.design/components/button-cn'
2.获取当前窗口域名
document.domain // 'ant.design'
window.location.hostname // 'ant.design'
3.获取当前窗口域名+端口(没有端口时,跟2获取的一致)
window.location.host // 'localhost:8849'
4.获取当前窗口协议+域名+端口
window.location.origin // 'http://localhost:8849'
5.获取当前窗口路径地址
window.location.pathname // '/components/button-cn/'
6.获取当前窗口协议
window.location.protocol // 'https:'