makeServerUrl(...) 统一使用 servXxx 变量,在配置文件中根据环境来设置 servXxx,不再使用 servXxxDev 变量
This commit is contained in:
parent
241798d443
commit
a325868e08
33
usertool.js
33
usertool.js
@ -70,8 +70,7 @@ export default {
|
|||||||
})
|
})
|
||||||
|
|
||||||
// #ifdef H5
|
// #ifdef H5
|
||||||
document.title =
|
document.title = windowTitle || wo?.envar?.callname?.[mylang] || pagesJson?.appInfo?.i18nText?.[mylang] || pagesJson?.globalStyle?.navigationBarTitleText // 必须放在 setNavigationBarTitle 之后,否则会被其覆盖掉。
|
||||||
windowTitle || wo?.envar?.Sys_Brand_Name?.[mylang] || pagesJson?.appInfo?.i18nText?.[mylang] || pagesJson?.globalStyle?.navigationBarTitleText // 必须放在 setNavigationBarTitle 之后,否则会被其覆盖掉。
|
|
||||||
// #endif
|
// #endif
|
||||||
|
|
||||||
// 必须要在有 tab 的页面里 setTabBarItem 才有效果
|
// 必须要在有 tab 的页面里 setTabBarItem 才有效果
|
||||||
@ -119,26 +118,18 @@ export default {
|
|||||||
return route
|
return route
|
||||||
}
|
}
|
||||||
|
|
||||||
let protocol, hostname, port
|
const protocol = envar.servProtocol || (process.env.NODE_ENV === 'production' ? 'https' : 'http')
|
||||||
|
let hostname = envar.servHostname
|
||||||
if (process.env.NODE_ENV === 'production') {
|
let port = envar.servPort
|
||||||
protocol = envar.servProtocol || 'https'
|
// #ifdef H5
|
||||||
hostname = envar.servHostname
|
if (!hostname) {
|
||||||
port = envar.servPort
|
hostname = window?.location?.hostname
|
||||||
} else {
|
|
||||||
protocol = envar.servProtocolDev || 'http'
|
|
||||||
hostname =
|
|
||||||
envar.servHostnameDev ||
|
|
||||||
// #ifdef H5
|
|
||||||
window.location.hostname
|
|
||||||
// #endif
|
|
||||||
port =
|
|
||||||
envar.servPortDev ||
|
|
||||||
envar.servPort ||
|
|
||||||
// #ifdef H5
|
|
||||||
window.location.port.replace(':', '')
|
|
||||||
// #endif
|
|
||||||
}
|
}
|
||||||
|
if (!port) {
|
||||||
|
port = window?.location?.port?.replace(':', '')
|
||||||
|
}
|
||||||
|
// #endif
|
||||||
|
|
||||||
return `${protocol}://${hostname}:${port}/${route.replace(/^\//, '')}`
|
return `${protocol}://${hostname}:${port}/${route.replace(/^\//, '')}`
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user