Fix H5 all-in-one asset paths

This commit is contained in:
Chopper711
2026-06-17 16:45:36 +08:00
parent a19f039da4
commit e4e6bd272c
11 changed files with 185 additions and 17 deletions

View File

@@ -2,6 +2,19 @@ const name = "lilishop"; //全局商城name
const schemeName = "lilishop"; //唤醒app需要的schemeName
const wapUrl = process.env.VUE_APP_WAP_URL || "https://m-b2b2c.pickmall.cn";
const loginCaptchaBypass = process.env.VUE_APP_LOGIN_CAPTCHA_BYPASS === "true";
const normalizeWsUrl = (url) => {
// H5 可使用同域相对路径,运行时按当前页面协议补齐 WebSocket 地址。
if (!url || /^wss?:\/\//.test(url)) {
return url || "";
}
// #ifdef H5
if (typeof window !== "undefined" && url.startsWith("/")) {
const protocol = window.location.protocol === "https:" ? "wss:" : "ws:";
return `${protocol}//${window.location.host}${url}`;
}
// #endif
return url;
};
export default {
name: name,
@@ -16,7 +29,7 @@ export default {
customerServiceMobile: "13161366885", //客服电话
customerServiceEmail: "lili@lili.com", //客服邮箱
imWebSrc: process.env.VUE_APP_IM_WEB_URL || "https://im.pickmall.cn", //IM地址
baseWsUrl: process.env.VUE_APP_IM_WS_URL || "wss://im-api.pickmall.cn/lili/webSocket", // IM WS 地址
baseWsUrl: normalizeWsUrl(process.env.VUE_APP_IM_WS_URL || "/lili/webSocket"), // IM WS 地址
loginCaptchaBypass,
enableGetClipboard: false, //是否启用粘贴板获取 scanAuthNavigation 中的链接,如果匹配则会跳转到对应页面
enableMiniBarStartUpApp: true, //是否在h5中右侧浮空按钮点击启动app