fix: 修复管理端静态资源基础路径
- 统一内置品牌资源与空状态图片的 BASE_URL 解析 - 应用启动时自动归一化历史偏好里的内置资源路径 - 多个空状态组件改为复用公共资源地址工具
This commit is contained in:
13
easyflow-ui-admin/app/src/utils/assets.ts
Normal file
13
easyflow-ui-admin/app/src/utils/assets.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
const assetBase = import.meta.env.BASE_URL || '/';
|
||||
|
||||
export function getPublicAssetUrl(path: string) {
|
||||
if (!path) {
|
||||
return assetBase;
|
||||
}
|
||||
const normalizedPath = path.startsWith('/') ? path.slice(1) : path;
|
||||
return `${assetBase}${normalizedPath}`;
|
||||
}
|
||||
|
||||
export function getEmptyStateImageUrl(themeMode?: string) {
|
||||
return getPublicAssetUrl(`empty${themeMode === 'dark' ? '-dark' : ''}.png`);
|
||||
}
|
||||
Reference in New Issue
Block a user