mirror of
https://gitee.com/spark-store-project/spark-store
synced 2026-09-21 06:00:11 +08:00
fix: 修复 before-quit 中 mainWindow 未定义报错,并优化排行榜加载
- electron/main/index.ts: flushSaveBounds 改用模块级 win 变量, 修复关闭应用时 mainWindow is not defined 的 ReferenceError - src/App.vue: loadRanking 并发数降至 15;loadHome 多来源请求并行化 - src/modules/ranking.ts: parseContributors 增强异常格式边界处理
This commit is contained in:
@@ -24,13 +24,14 @@ export interface ContributorRank {
|
||||
* 聚合与展示统一去除 `<...>` 取显示名。
|
||||
*/
|
||||
export function parseContributors(raw: string | undefined): string[] {
|
||||
if (!raw) return [];
|
||||
if (!raw || typeof raw !== "string") return [];
|
||||
const names: string[] = [];
|
||||
for (const part of raw.split(/[;;]/)) {
|
||||
const trimmed = part.trim();
|
||||
if (!trimmed) continue;
|
||||
// 去除 <...> 包裹的邮箱,取显示名;长度 1~50 过滤空字符串/异常超长
|
||||
const name = trimmed.replace(/<[^>]*>/g, "").trim();
|
||||
if (name) names.push(name);
|
||||
if (name.length > 0 && name.length <= 50) names.push(name);
|
||||
}
|
||||
return names;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user