diff --git a/src/lib/config.ts b/src/lib/config.ts index 63a2a1d..61a5644 100644 --- a/src/lib/config.ts +++ b/src/lib/config.ts @@ -102,6 +102,15 @@ async function initConfig() { }); } }); + + // 检查现有源是否在 fileConfig.api_site 中,如果不在则标记为 custom + const apiSiteKeys = new Set(apiSiteEntries.map(([key]) => key)); + adminConfig.SourceConfig.forEach((source) => { + if (!apiSiteKeys.has(source.key)) { + source.from = 'custom'; + } + }); + const existedUsers = new Set( (adminConfig.UserConfig.Users || []).map((u) => u.username) );