use SERVER_PROTOCOL as default port

This commit is contained in:
陆柯 2021-09-06 20:40:17 +08:00
parent 223b9009fe
commit c8ae157906

View File

@ -88,16 +88,16 @@ module.exports = {
// #ifdef H5 // #ifdef H5
|| window.location.hostname || window.location.hostname
// #endif // #endif
protocol = 'https:' protocol = this.SERVER_PROTOCOL || 'https'
} else { } else {
hostname = hostname =
// #ifdef H5 // #ifdef H5
window.location.hostname || window.location.hostname ||
// #endif // #endif
this.SERVER_HOSTNAME_DEV // 在本机的手机模拟器里可以在虚拟机的浏览器里也可以但是运行到连接的iPhone里就无法连接不知为何 this.SERVER_HOSTNAME_DEV // 在本机的手机模拟器里可以在虚拟机的浏览器里也可以但是运行到连接的iPhone里就无法连接不知为何
protocol = 'http:' protocol = 'http'
} }
return `${protocol}//${hostname}:${port}/${route}` return `${protocol}://${hostname}:${port}/${route}`
}, },
makeBgUrl(path) { makeBgUrl(path) {