refactor(Web): update type casting and remove unused imports

This commit is contained in:
ShiYu
2025-05-31 23:07:12 +08:00
parent 44d2616fd4
commit 6433781f07
3 changed files with 5 additions and 6 deletions

3
.gitignore vendored
View File

@@ -24,4 +24,5 @@ dist-ssr
/obj
/Uploads
/appsettings.Development.json
/Foxel.sln.DotSettings.user
/Foxel.sln.DotSettings.user
/Folder.DotSettings.user

View File

@@ -41,7 +41,7 @@ const BackgroundTasks: React.FC = () => {
// 设置轮询
if (pollingActive) {
const interval = setInterval(fetchTasks, 3000);
setPollingIntervalState(interval);
setPollingIntervalState(interval as unknown as number);
}
return () => {
@@ -66,7 +66,7 @@ const BackgroundTasks: React.FC = () => {
} else if (hasActiveTasks && !pollingActive) {
setPollingActive(true);
const interval = setInterval(fetchTasks, 3000);
setPollingIntervalState(interval);
setPollingIntervalState(interval as unknown as number);
}
}, [tasks, pollingActive, pollingInterval, fetchTasks]);

View File

@@ -1,12 +1,10 @@
import { Tabs, Layout, Menu, Space } from 'antd';
import { useAuth } from '../../auth/AuthContext.tsx';
import { UserRole } from '../../api/types';
import { useState, type SetStateAction } from 'react';
import UserProfile from './UserProfile.tsx';
import useIsMobile from '../../hooks/useIsMobile';
import {
UserOutlined,
SettingOutlined,
BgColorsOutlined,
BellOutlined,
} from '@ant-design/icons';
@@ -15,7 +13,7 @@ const { TabPane } = Tabs;
const { Sider, Content } = Layout;
function Settings() {
const { hasRole } = useAuth();
useAuth();
const isMobile = useIsMobile();
const [activeMenu, setActiveMenu] = useState('profile');
const [activeTab, setActiveTab] = useState('basic');