allow H5 to use window.location.hostname instead of SERVER_HOSTNAME_DEV

This commit is contained in:
陆柯 2021-08-28 16:19:30 +08:00
parent d805b34769
commit fadd6abc58

View File

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