This commit is contained in:
ryan
2026-06-09 08:19:38 +08:00
parent d14d222ede
commit 7579d3865f
15 changed files with 30 additions and 40 deletions
@@ -38,8 +38,8 @@ export function InfoTab({ systemConfigsLength, authSourcesLength }: InfoTabProps
<InfoRow label="应用名称" value={packageJson.name} />
<InfoRow label="版本号" value={packageJson.version} />
<InfoRow label="构建时间" value={packageJson.buildDate} />
<InfoRow label="Next.js" value={(packageJson as any).dependencies.next} />
<InfoRow label="React" value={(packageJson as any).dependencies.react} />
<InfoRow label="Next.js" value={(packageJson as { dependencies?: Record<string, string> }).dependencies?.next} />
<InfoRow label="React" value={(packageJson as { dependencies?: Record<string, string> }).dependencies?.react} />
</CardContent>
</Card>
@@ -53,10 +53,9 @@ const MENU_GROUPS = [
interface OtherTabProps {
configs: Record<string, SystemConfig>
systemConfigsQuery: any
}
export function OtherTab({ configs, systemConfigsQuery }: OtherTabProps) {
export function OtherTab({ configs }: OtherTabProps) {
const queryClient = useQueryClient()
const menuDisplayConfig = useMemo(() => {
@@ -92,7 +92,7 @@ export function ProfileMain() {
}, [user, isEditDialogOpen])
const changePasswordMutation = useMutation({
mutationFn: (req: any) => AuthService.changePassword(req),
mutationFn: AuthService.changePassword,
onSuccess: () => {
toast.success("密码修改成功")
setOldPassword("")
@@ -122,7 +122,7 @@ export function ProfileMain() {
}
const updateProfileMutation = useMutation({
mutationFn: (req: any) => AuthService.updateProfile(req),
mutationFn: AuthService.updateProfile,
onSuccess: () => {
toast.success("个人信息修改成功")
setIsEditDialogOpen(false)
@@ -197,8 +197,8 @@ export function ProfileMain() {
setIsCropDialogOpen(false)
setCropFile(null)
toast.success("头像上传成功,点击保存以生效")
} catch (err: any) {
toast.error(err.message || "上传头像失败")
} catch (err) {
toast.error((err as Error).message || "上传头像失败")
}
}
@@ -1,7 +1,7 @@
"use client"
import {useEffect, useState} from "react"
import {useMutation, useQuery, useQueryClient} from "@tanstack/react-query"
import {useMutation, useQuery, useQueryClient, type UseQueryResult} from "@tanstack/react-query"
import {Fingerprint, Globe, Loader2, Lock, Mail, Pencil, Plus, Settings, Shield, Trash2, UserPlus} from "lucide-react"
import {Button} from "@/components/ui/button"
@@ -55,7 +55,7 @@ const SECURITY_KEYS = [
interface SecurityTabProps {
configs: Record<string, SystemConfig>
systemConfigsQuery: any
systemConfigsQuery: UseQueryResult<SystemConfig[], Error>
}
export function SecurityTab({ configs, systemConfigsQuery }: SecurityTabProps) {
@@ -102,7 +102,7 @@ export function SystemSettingsMain() {
<SystemStatusManager />
</TabsContent>
<TabsContent value="other" className="pt-4">
<OtherTab configs={configs} systemConfigsQuery={systemConfigsQuery} />
<OtherTab configs={configs} />
</TabsContent>
<TabsContent value="info" className="pt-4">
<InfoTab
@@ -1,7 +1,7 @@
"use client"
import {useEffect, useState} from "react"
import {useMutation, useQueryClient} from "@tanstack/react-query"
import {useMutation, useQueryClient, type UseQueryResult} from "@tanstack/react-query"
import {Loader2, Mail, Server} from "lucide-react"
import {Button} from "@/components/ui/button"
@@ -15,7 +15,7 @@ import {toast} from "sonner"
interface SystemTabProps {
configs: Record<string, SystemConfig>
systemConfigsQuery: any
systemConfigsQuery: UseQueryResult<SystemConfig[], Error>
}
export function SystemTab({ configs, systemConfigsQuery }: SystemTabProps) {