使用:location.host(ps:获取本地的端口号)
示例
let DominHost = location.host.indexOf('calhost') > 0 ? 'http://ch1.hrshost.com' : '//' + location.host;
说明:
判断当前location.host是否包含location,如果包含则是本地,可以指定本地时的请求头,不包含说明在服务器上,则用location.host就行,
let DominHost = location.host.indexOf('calhost') > 0 ? 'http://ch1.hrshost.com' : '//' + location.host;
判断当前location.host是否包含location,如果包含则是本地,可以指定本地时的请求头,不包含说明在服务器上,则用location.host就行,