u
This commit is contained in:
parent
c2b9f21ecc
commit
506dabb27f
@ -122,7 +122,6 @@ export default {
|
|||||||
return route
|
return route
|
||||||
}
|
}
|
||||||
|
|
||||||
const protocol = envar.servProtocol || (process.env.NODE_ENV === 'production' ? 'https' : 'http')
|
|
||||||
let hostname = envar.servHostname
|
let hostname = envar.servHostname
|
||||||
let port = envar.servPort
|
let port = envar.servPort
|
||||||
// #ifdef H5
|
// #ifdef H5
|
||||||
@ -134,10 +133,12 @@ export default {
|
|||||||
}
|
}
|
||||||
// #endif
|
// #endif
|
||||||
if (!hostname) {
|
if (!hostname) {
|
||||||
// 如果没有配置 hostname,又不是在 H5 环境,则最后的默认值是 localhost
|
// 如果没有配置 envar.servHostname,又不是在 H5 环境,则最后的默认值是 localhost
|
||||||
hostname = 'localhost'
|
hostname = 'localhost'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const protocol = hostname === 'localhost' ? 'http' : envar.servProtocol || (process.env.NODE_ENV === 'production' ? 'https' : 'http')
|
||||||
|
|
||||||
return `${protocol}://${hostname}:${port}/${route.replace(/^\//, '')}`
|
return `${protocol}://${hostname}:${port}/${route.replace(/^\//, '')}`
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user