var getBaseUrl = function () {
//protocol 属性是一个可读可写的字符串,可设置或返回当前 URL 的协议,所有主要浏览器都支持 protocol 属性
var ishttps = 'https:' == document.location.protocol ? true: false;
var url = window.location.host;
if(ishttps){
url = 'https://' + url;
}else{
url = 'http://' + url;
}
return url;
}