Przeglądaj źródła

修改菜单不显示问题

hurx 21 godzin temu
rodzic
commit
548dc48422
1 zmienionych plików z 6 dodań i 0 usunięć
  1. 6 0
      src/utils/platform.ts

+ 6 - 0
src/utils/platform.ts

@@ -34,12 +34,18 @@ export function getPlatformCode(): PlatformCode {
   }
 
   // 生产环境:泛解析 *.yoe365.com
+  const prodAliasMap: Record<string, PlatformCode> = {
+    'work': 'market'
+  };
   const PROD_DOMAIN_SUFFIX = '.yoe365.com';
   if (host.endsWith(PROD_DOMAIN_SUFFIX)) {
     const subdomain = host.slice(0, -PROD_DOMAIN_SUFFIX.length);
     if (SUPPORTED_PLATFORMS.includes(subdomain as PlatformCode)) {
       return subdomain as PlatformCode;
     }
+    if (prodAliasMap[subdomain]) {
+      return prodAliasMap[subdomain];
+    }
   }
 
   // IP 地址或未知域名 → 默认 market(开发友好)