fix: 修复合并后 TypeScript 编译错误

- 补充 RefObject import(local-captcha、slider-captcha、node-group-form)
- 删除 slider-captcha 中无用的 _scaleX/_scaleY 变量
- user_subscribe_id 类型转换 number → string
- 移除 services 文件中失效的 @ts-expect-error 指令
This commit is contained in:
2026-03-24 01:23:36 -07:00
parent ef54d2479d
commit 8d0ddbb5ef
28 changed files with 167 additions and 30 deletions
@@ -2,7 +2,13 @@ import { Button } from "@workspace/ui/components/button";
import { Input } from "@workspace/ui/components/input";
import { Icon } from "@workspace/ui/composed/icon";
import { adminGenerateCaptcha } from "@workspace/ui/services/admin/auth";
import { useEffect, useImperativeHandle, useState } from "react";
import {
type RefObject,
useEffect,
useImperativeHandle,
useState,
} from "react";
import { useTranslation } from "react-i18next";
export interface LocalCaptchaRef {
@@ -10,7 +10,14 @@ import {
adminGenerateCaptcha,
adminVerifyCaptchaSlider,
} from "@workspace/ui/services/admin/auth";
import { useCallback, useImperativeHandle, useRef, useState } from "react";
import {
type RefObject,
useCallback,
useImperativeHandle,
useRef,
useState,
} from "react";
import { useTranslation } from "react-i18next";
export interface SliderCaptchaRef {
@@ -105,9 +112,7 @@ const SliderCaptcha = ({
(e.target as HTMLElement).setPointerCapture(e.pointerId);
e.preventDefault();
const { w, h } = getContainerSize();
const _scaleX = BG_NATURAL_WIDTH / w;
const _scaleY = BG_NATURAL_HEIGHT / h;
const { w: _w, h: _h } = getContainerSize();
trail.current.push({
x: Math.round(startBlock.current.x),
y: Math.round(startBlock.current.y),
@@ -13,7 +13,7 @@ import { Label } from "@workspace/ui/components/label";
import { Switch } from "@workspace/ui/components/switch";
import { Textarea } from "@workspace/ui/components/textarea";
import { AlertCircle, Loader2 } from "lucide-react";
import { useEffect, useState } from "react";
import { type RefObject, useEffect, useState } from "react";
import { useTranslation } from "react-i18next";
interface NodeGroupFormProps {
@@ -446,7 +446,7 @@ function RowReadOnlyActions({
"This action cannot be undone."
)}
onConfirm={async () => {
await deleteUserSubscribe({ user_subscribe_id: row.id });
await deleteUserSubscribe({ user_subscribe_id: String(row.id) });
toast.success(t("deleteSuccess", "Deleted successfully"));
refresh?.();
}}