feat: 技术支持工单/企微权限/开发版本管理/消息推送等迭代

This commit is contained in:
2026-08-04 21:32:13 +08:00
parent c8ea5a3119
commit 9d96c73246
1341 changed files with 0 additions and 195605 deletions
-25
View File
@@ -1,25 +0,0 @@
/// <reference types="vite/client" />
function normalizeBase(base?: string): string {
if (!base || base === '/') return '';
return base.replace(/\/$/, '');
}
/** React Router basename(来自 Vite `base` */
export function getRouterBasename(baseUrl?: string): string | undefined {
const base = normalizeBase(baseUrl ?? import.meta.env?.BASE_URL);
return base || undefined;
}
/** 拼接带 Vite base 前缀的应用内路径(用于 window.location 跳转) */
export function toAppPath(path: string, baseUrl?: string): string {
const base = normalizeBase(baseUrl ?? import.meta.env?.BASE_URL);
const normalized = path.startsWith('/') ? path : `/${path}`;
return `${base}${normalized}`;
}
export function isOnAppPath(path: string, baseUrl?: string): boolean {
if (typeof window === 'undefined') return false;
const target = toAppPath(path, baseUrl);
return window.location.pathname === target || window.location.pathname.startsWith(`${target}/`);
}