diff --git a/usertool.js b/usertool.js index 761874e..f2925c6 100644 --- a/usertool.js +++ b/usertool.js @@ -70,8 +70,7 @@ export default { }) // #ifdef H5 - document.title = - windowTitle || wo?.envar?.Sys_Brand_Name?.[mylang] || pagesJson?.appInfo?.i18nText?.[mylang] || pagesJson?.globalStyle?.navigationBarTitleText // 必须放在 setNavigationBarTitle 之后,否则会被其覆盖掉。 + document.title = windowTitle || wo?.envar?.callname?.[mylang] || pagesJson?.appInfo?.i18nText?.[mylang] || pagesJson?.globalStyle?.navigationBarTitleText // 必须放在 setNavigationBarTitle 之后,否则会被其覆盖掉。 // #endif // 必须要在有 tab 的页面里 setTabBarItem 才有效果 @@ -119,26 +118,18 @@ export default { return route } - let protocol, hostname, port - - if (process.env.NODE_ENV === 'production') { - protocol = envar.servProtocol || 'https' - hostname = envar.servHostname - port = envar.servPort - } 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 + const protocol = envar.servProtocol || (process.env.NODE_ENV === 'production' ? 'https' : 'http') + let hostname = envar.servHostname + let port = envar.servPort + // #ifdef H5 + if (!hostname) { + hostname = window?.location?.hostname } + if (!port) { + port = window?.location?.port?.replace(':', '') + } + // #endif + return `${protocol}://${hostname}:${port}/${route.replace(/^\//, '')}` },