This commit is contained in:
陆柯 2022-06-08 21:52:52 +08:00
parent f6e0ff9660
commit 9525930dfb

View File

@ -129,6 +129,10 @@ export default {
port = window?.location?.port?.replace(':', '') port = window?.location?.port?.replace(':', '')
} }
// #endif // #endif
if (!hostname) {
// 如果没有配置 hostname又不是在 H5 环境,则最后的默认值是 localhost
hostname = 'localhost'
}
return `${protocol}://${hostname}:${port}/${route.replace(/^\//, '')}` return `${protocol}://${hostname}:${port}/${route.replace(/^\//, '')}`
}, },