同步 sgs-frontend-mobile 源码
Some checks failed
CI / verify (push) Has been cancelled

This commit is contained in:
lyf
2026-07-27 11:26:01 +08:00
parent 575dca430f
commit 9ea1bfab71
181 changed files with 24395 additions and 5212 deletions

View File

@@ -22,8 +22,30 @@ const configuredLegacyAudioHosts = () => [
...defaultLegacyAudioHosts
].filter(Boolean)
const resolveSdkMinioProxyBaseUrl = () => {
const apiBaseUrl = dataSourceConfig.apiBaseUrl.trim().replace(/\/+$/, '')
const normalizedApiBaseUrl = apiBaseUrl.endsWith('/app-api')
? apiBaseUrl
: `${apiBaseUrl}/app-api`
return `${normalizedApiBaseUrl}/gis/sdk/minio`
}
const toSdkMinioProxyUrl = (assetPath: string) => `${resolveSdkMinioProxyBaseUrl()}${assetPath}`
export const normalizeSameOriginPublicUrl = (url: string | null | undefined) => {
const value = url?.trim()
// The SDK proxy is public and provides the same disk and HTTP cache used by
// the kiosk client. Guide images and audio should use it instead of bypassing
// the cache through the MinIO public endpoint.
if (value?.startsWith('/minio/museum-assets/')) {
return toSdkMinioProxyUrl(value.replace(/^\/minio/, ''))
}
if (value?.startsWith('/museum-assets/') || value?.startsWith('/tts-audio/')) {
return toSdkMinioProxyUrl(value)
}
if (!value || !isAbsoluteHttpUrl(value)) return value || ''
try {
@@ -38,7 +60,7 @@ export const normalizeSameOriginPublicUrl = (url: string | null | undefined) =>
|| parsed.pathname.startsWith('/tts-audio/')
)
) {
return `${parsed.pathname}${parsed.search}${parsed.hash}`
return toSdkMinioProxyUrl(`${parsed.pathname}${parsed.search}${parsed.hash}`)
}
if (