fix: 问题追踪附件改为图片展示,登录失败透出服务端原因
Sync source to CNB / Sync Git ref (push) Skipped

- 附件图片通过带凭据的请求拉取后以 blob URL 渲染,卸载时回收
- 皮肤站玩家登录失败时优先展示服务端返回的 errorMessage
This commit is contained in:
AxTps committed 2026-10-23 21:27:12 +08:00
1 parent 227af685d4
commit ec89ec5cec
3 files changed
+81 -9

No files matched your search

@@ -692,6 +692,24 @@ export interface SkinSiteBugImage {
[key: string]: unknown
}
/** Download a bug attachment image. The endpoint requires auth, so the image
* must be fetched as a blob and rendered through an object URL. */
export async function skinSiteBugImageFetch(hash: string): Promise<Blob | null> {
const url = `${SKIN_SITE_ORIGIN}${REQUEST_TYPE_PATH.starlight}/bug/images/${encodeURIComponent(hash)}`
const headers: Record<string, string> = { Accept: 'image/*' }
const token = getSkinSiteToken()
if (token) headers['Authorization'] = `Bearer ${token}`
try {
const response = await tauriFetch(url, { method: 'GET', headers })
if (!response.ok) return null
const type = response.headers.get('content-type') ?? ''
if (type.includes('application/json') || type.includes('text/')) return null
return await response.blob()
} catch {
return null
}
}
export interface SkinSiteBugIssue {
id: number
type: SkinSiteBugIssueType