|
|
@@ -79,6 +79,23 @@ export function parseEpIconUrl(iconUrl) {
|
|
|
return { icon, bg, fg: iconFgFromBg(bg) }
|
|
|
}
|
|
|
|
|
|
+/**
|
|
|
+ * 旧版静态图标存 `/oa-app-icons/*.svg`(web-admin/public)。
|
|
|
+ * 小程序/H5 需走 `static/oa-app-icons/`,否则 5173 下 404。
|
|
|
+ */
|
|
|
+export function resolveOaAppIconImageSrc(iconUrl) {
|
|
|
+ const u = String(iconUrl || '').trim()
|
|
|
+ if (!u || isEpIconUrl(u)) return ''
|
|
|
+ if (/^https?:\/\//i.test(u)) return u
|
|
|
+ if (u.startsWith('/oa-app-icons/')) {
|
|
|
+ return '/static' + u
|
|
|
+ }
|
|
|
+ if (u.startsWith('/static/')) return u
|
|
|
+ if (u.startsWith('/')) return u
|
|
|
+ // MinIO 相对 key:由调用方或 config 拼完整 URL;此处原样返回
|
|
|
+ return u
|
|
|
+}
|
|
|
+
|
|
|
export function resolveOaAppIcon(iconUrl) {
|
|
|
const u = String(iconUrl || '').trim()
|
|
|
if (!u) {
|
|
|
@@ -89,10 +106,7 @@ export function resolveOaAppIcon(iconUrl) {
|
|
|
const p = parseEpIconUrl(u)
|
|
|
return { kind: 'ep', icon: p.icon, bg: p.bg, fg: p.fg }
|
|
|
}
|
|
|
- if (/^https?:\/\//i.test(u) || u.startsWith('/')) {
|
|
|
- return { kind: 'image', src: u }
|
|
|
- }
|
|
|
- return { kind: 'image', src: u }
|
|
|
+ return { kind: 'image', src: resolveOaAppIconImageSrc(u) }
|
|
|
}
|
|
|
|
|
|
const EP_ICON_SVG_INNER = {
|