fix: 资源下载接口带上登录凭据
Sync source to CNB / Sync Git ref (push) Skipped

download/list、download/count、download/category/list 在后端位于 requireLogin 内,
前端却以 auth: false 请求,未携带 token 导致 401,已登录用户也被提示未登录。
This commit is contained in:
AxTps committed 2026-10-22 21:43:38 +08:00
1 parent 30fbf5e5a6
commit fdfc2d36f5
1 file changed
+3 -7
@@ -556,22 +556,18 @@ export function skinSitePublicDownloadList(options?: {
offset: String(options?.offset ?? 0), offset: String(options?.offset ?? 0),
}) })
if (options?.category) query.set('category', options.category) if (options?.category) query.set('category', options.category)
return skinSiteRequest<SkinSitePublicDownloadItem[]>(`download/list?${query.toString()}`, { return skinSiteRequest<SkinSitePublicDownloadItem[]>(`download/list?${query.toString()}`)
auth: false,
})
} }
export function skinSitePublicDownloadCount(category?: string): Promise<SkinSiteResponse<number>> { export function skinSitePublicDownloadCount(category?: string): Promise<SkinSiteResponse<number>> {
const suffix = category ? `?category=${encodeURIComponent(category)}` : '' const suffix = category ? `?category=${encodeURIComponent(category)}` : ''
return skinSiteRequest<number>(`download/count${suffix}`, { auth: false }) return skinSiteRequest<number>(`download/count${suffix}`)
} }
export function skinSitePublicDownloadCategories(): Promise< export function skinSitePublicDownloadCategories(): Promise<
SkinSiteResponse<SkinSitePublicDownloadCategory[]> SkinSiteResponse<SkinSitePublicDownloadCategory[]>
> { > {
return skinSiteRequest<SkinSitePublicDownloadCategory[]>('download/category/list', { return skinSiteRequest<SkinSitePublicDownloadCategory[]>('download/category/list')
auth: false,
})
} }
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
// Maps // Maps