style(copy): fix remaining punctuation violations and make check:copy strict
Auto-fix of 602 string literals across 74 files (half-width punctuation next to Chinese, parenthesised Chinese, quotes); biome reflow; e2/e6 assertions follow the new full-width summaries. check:copy now runs with --strict in ci. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
0fccfe257d
commit
fb84a71f80
76 files changed
+582
-570
No files matched your search
@@ -342,7 +342,7 @@ export async function refreshSiteAccount(
|
||||
decisionId: null,
|
||||
});
|
||||
const def = getSiteDefinition(site.key);
|
||||
if (!def || site.deleted_at) return unchanged("unsupported", "站点没有适配器定义,无法校验登录");
|
||||
if (!def || site.deleted_at) return unchanged("unsupported", "站点没有适配器定义,无法校验登录");
|
||||
const defaults = await rt.siteDefaults();
|
||||
const ua = acc.user_agent ?? defaults.userAgent;
|
||||
let limiter: ReturnType<SourcesRuntime["limiterOf"]> = null;
|
||||
@@ -402,7 +402,7 @@ export async function refreshSiteAccount(
|
||||
const succeed = (info: SiteUserInfo | null, note?: string) => markSuccess(rt, acc, site, info, actor, note);
|
||||
|
||||
try {
|
||||
if (acc.auth_kind === "passkey") return unchanged("unsupported", "Passkey 只用于 RSS 和下载,不参与登录");
|
||||
if (acc.auth_kind === "passkey") return unchanged("unsupported", "Passkey 只用于 RSS 和下载,不参与登录");
|
||||
if (!acc.secret_ref) return unchanged("unsupported", "账号没有凭证");
|
||||
if (acc.auth_kind === "password") {
|
||||
if (umt.kind !== "nexusphp" || !umt.login) {
|
||||
@@ -434,14 +434,14 @@ export async function refreshSiteAccount(
|
||||
if (r.kind === "ok") return await succeed(r.info);
|
||||
return await succeed(
|
||||
null,
|
||||
`登录成功;用户数据未取到:${r.kind === "no_parser" ? "站点没有用户数据解析器" : r.message}`,
|
||||
`登录成功;用户数据未取到:${r.kind === "no_parser" ? "站点没有用户数据解析器" : r.message}`,
|
||||
);
|
||||
}
|
||||
const plain = await secrets.resolve(acc.secret_ref);
|
||||
let r = await fetchUserData(acc.auth_kind === "cookie" ? { cookie: plain } : { apikey: plain });
|
||||
if (r.kind === "no_parser") r = await viaHealth();
|
||||
if (r.kind === "ok") return await succeed(r.info);
|
||||
if (r.kind === "no_parser") return await succeed(null, "站点没有用户数据解析器,只校验了登录态");
|
||||
if (r.kind === "no_parser") return await succeed(null, "站点没有用户数据解析器,只校验了登录态");
|
||||
if (r.kind === "network") return await fail("network", r.message);
|
||||
if (r.kind === "challenge") return await fail("challenge", r.message);
|
||||
return await fail(
|
||||
@@ -580,11 +580,11 @@ async function upsertUserDataDay(trx: Exec, accountId: string, now: Date, info:
|
||||
const DECISION_TEXT: Record<string, { title: (s: string) => string; summary: string }> = {
|
||||
challenge: {
|
||||
title: (s) => `站点「${s}」登录需要人工验证`,
|
||||
summary: "登录页要求验证码 / 二次验证,无法自动登录。改用 Cookie 登录,或填写 TOTP 密钥后重试",
|
||||
summary: "登录页要求验证码 / 二次验证,无法自动登录。改用 Cookie 登录,或填写 TOTP 密钥后重试",
|
||||
},
|
||||
invalid: {
|
||||
title: (s) => `站点「${s}」登录失败`,
|
||||
summary: "用户名或密码错误,或账号被封禁 / 未确认。更新凭证后重新刷新登录",
|
||||
summary: "用户名或密码错误,或账号被封禁 / 未确认。更新凭证后重新刷新登录",
|
||||
},
|
||||
expired: {
|
||||
title: (s) => `站点「${s}」登录失效`,
|
||||
@@ -619,7 +619,7 @@ async function markFailure(
|
||||
const text = DECISION_TEXT[status]!;
|
||||
const summary =
|
||||
reason === "challenge"
|
||||
? "站点返回 Cloudflare 挑战页,无法自动登录。改用 Cookie 登录"
|
||||
? "站点返回 Cloudflare 挑战页,无法自动登录。改用 Cookie 登录"
|
||||
: status === "expired" ||
|
||||
reason === "account_blocked" ||
|
||||
reason === "bad_credentials" ||
|
||||
@@ -719,7 +719,7 @@ export async function checkSiteHealth(
|
||||
let message: string | null = null;
|
||||
const def = getSiteDefinition(site.key);
|
||||
if (!def) {
|
||||
message = "站点没有适配器定义,无法检测";
|
||||
message = "站点没有适配器定义,无法检测";
|
||||
status = "unsupported";
|
||||
} else {
|
||||
await rt.siteDefaults();
|
||||
|
||||
Reference in new issue
Block a user