diff --git a/src/api/types.gen.ts b/src/api/types.gen.ts index 86ef9d0..9aaf897 100644 --- a/src/api/types.gen.ts +++ b/src/api/types.gen.ts @@ -50,7 +50,7 @@ export interface paths { content: { "application/json": { /** - * @example archived + * @example all * @enum {string|null} */ state?: "active" | "archived" | "trashed" | "all" | null; @@ -539,7 +539,7 @@ export interface paths { */ language_code?: string; /** - * @example draft + * @example published * @enum {string} */ status?: "draft" | "awaiting_publish" | "published"; @@ -4685,7 +4685,7 @@ export interface paths { content: { "application/json": { /** - * @example viewed + * @example taken_by_other * @enum {string|null} */ status?: "sent" | "delivered" | "viewed" | "accepted" | "rejected" | "ignored" | "expired" | "taken_by_other" | null; @@ -5163,7 +5163,7 @@ export interface paths { content: { "application/json": { /** - * @example inactive + * @example busy * @enum {string|null} */ status?: "offline" | "online" | "inactive" | "busy" | null; @@ -5448,12 +5448,12 @@ export interface paths { content: { "application/json": { /** - * @example private + * @example friends * @enum {string|null} */ visibility?: "public" | "friends" | "private" | null; /** - * @example blocked + * @example visible * @enum {string|null} */ status?: "blocked" | "visible" | "all" | null; @@ -5779,7 +5779,7 @@ export interface paths { content: { "application/json": { /** - * @example all + * @example pending * @enum {string|null} */ status?: "pending" | "blocked" | "all" | null; @@ -9744,7 +9744,7 @@ export interface paths { content: { "application/json": { /** - * @example all + * @example blocked * @enum {string|null} */ status?: "pending" | "blocked" | "all" | null; @@ -10107,11 +10107,11 @@ export interface paths { content: { "application/json": { /** - * @example web + * @example android * @enum {string|null} */ platform?: "ios" | "android" | "web" | "desktop" | null; - /** @example false */ + /** @example true */ is_online?: boolean | null; /** * @description Must be at least 1. @@ -11170,7 +11170,7 @@ export interface operations { content: { "application/json": { /** - * @description SID 值,支持带/不带横杠。 + * @description SID 值,格式为 3 位非歧义字母加 6 位数字,支持带/不带横杠。 * @example ABC-888888 */ sid: string; @@ -11214,7 +11214,7 @@ export interface operations { */ user_uid: string; /** - * @description SID 值,支持带/不带横杠。 + * @description SID 值,格式为 3 位非歧义字母加 6 位数字,支持带/不带横杠。 * @example ABC-168888 */ sid: string; diff --git a/src/routes/_authed/sid.tsx b/src/routes/_authed/sid.tsx index dc265a4..3c4e0da 100644 --- a/src/routes/_authed/sid.tsx +++ b/src/routes/_authed/sid.tsx @@ -70,6 +70,18 @@ function RulesTab() { } } + if (rules.isPending) return

正在加载保留规则…

+ if (rules.isError) { + return ( +
+

保留规则加载失败。

+ +
+ ) + } + return (
{(rules.data?.data ?? []).map((rule) => ( @@ -131,6 +143,18 @@ function LuckyTab() { } } + if (numbers.isPending) return

正在加载幸运号码…

+ if (numbers.isError) { + return ( +
+

幸运号码加载失败。

+ +
+ ) + } + return (
@@ -140,8 +164,10 @@ function LuckyTab() { id="lucky-number" className="w-32 font-mono" maxLength={3} + inputMode="numeric" + pattern="[0-9]{3}" value={draft.number} - onChange={(e) => setDraft((d) => ({ ...d, number: e.target.value }))} + onChange={(e) => setDraft((d) => ({ ...d, number: e.target.value.replace(/\D/g, '') }))} placeholder="888" />
@@ -198,6 +224,8 @@ function AssignTab() { const [checkResult, setCheckResult] = useState(null) const [userUid, setUserUid] = useState('') const [busy, setBusy] = useState(false) + const validSid = /^[A-HJ-NPR-Z]{3}-?\d{6}$/i.test(sid) + const validUid = /^[0-9A-HJKMNP-TV-Z]{26}$/i.test(userUid) const check = async () => { setBusy(true) @@ -238,11 +266,14 @@ function AssignTab() { id="sid-input" className="font-mono" value={sid} - onChange={(e) => setSid(e.target.value)} - placeholder="668888" + onChange={(e) => { + setSid(e.target.value.toUpperCase()) + setCheckResult(null) + }} + placeholder="ABC-668888" />
-
@@ -270,14 +301,21 @@ function AssignTab() { setUserUid(e.target.value)} + onChange={(e) => setUserUid(e.target.value.toUpperCase())} placeholder="01JXXXXXXXXXXXXXXXXXXXXXXX" />