mirror of
https://github.com/lingke-net/koring-space.git
synced 2026-09-12 05:45:17 +08:00
- 新增 /download 下载页:正式版/预览版双渠道、latest.yml/latest-beta.yml 数据源、镜像下载源切换、SHA512 校验展示 - 新增 /api/download-version:GitHub API 自动识别 + 镜像兜底 + yml 解析 + 旧源兜底 - /launcher/join-beta 改为自动识别 GitHub 预览版,支持镜像下载源切换 - 新增 markdown-lite 轻量渲染器、lib/download-sources 与 lib/github-releases 共享模块 - 头部导航新增下载中心入口
22 lines
940 B
TypeScript
22 lines
940 B
TypeScript
/** 下载源列表:GitHub 官方直链 + 国内镜像(格式 {镜像}/{GitHub 直链}) */
|
||
export const DOWNLOAD_SOURCES = [
|
||
{ key: "github", label: "GitHub 官方", url: (u: string) => u },
|
||
{ key: "ddlc", label: "镜像 · ddlc", url: (u: string) => `https://gh.ddlc.top/${u}` },
|
||
{ key: "proxy", label: "镜像 · proxy", url: (u: string) => `https://gh-proxy.com/${u}` },
|
||
{ key: "fast", label: "镜像 · fast", url: (u: string) => `https://ghfast.top/${u}` },
|
||
] as const;
|
||
|
||
export type DownloadSourceKey = (typeof DOWNLOAD_SOURCES)[number]["key"];
|
||
|
||
export function resolveDownloadUrl(source: DownloadSourceKey, url: string) {
|
||
const s = DOWNLOAD_SOURCES.find((d) => d.key === source);
|
||
return s ? s.url(url) : url;
|
||
}
|
||
|
||
/** 服务端拉取 GitHub 数据(yml / release 页面)时使用的镜像前缀 */
|
||
export const DATA_MIRRORS = [
|
||
"https://gh.ddlc.top",
|
||
"https://gh-proxy.com",
|
||
"https://ghfast.top",
|
||
] as const;
|