refactor: 消除所有 api-services-raw 残留调用,API 口径完全统一
- dashboardApi 新增 resolveTodo/ignoreTodo/batchResolveTodos/batchIgnoreTodos - notificationsApi 新增 checkContracts/test - settingsApi 新增 confirmRetirementPolicy - socialInsuranceApi 新增 monthlyChanges/housingMonthlyChanges/housingActiveDeclaration - Dashboard.tsx 替换 4 处 apiPatch - Settings.tsx 替换 4 处 apiPost - Notifications.tsx 替换 1 处 apiPost - SocialInsurance.tsx 替换 4 处 apiGet - AIAssistant.tsx 移除未使用的 apiPost 导入 - 所有页面零 api-services-raw 依赖
This commit is contained in:
@@ -5,7 +5,6 @@ import { useConfirm } from '../hooks/useConfirm'
|
||||
import { Calculator, Info, Check, Settings as SettingsIcon, Plus, History, Download, AlertCircle, Clock, MapPin, Sparkles, Upload, X, Shield } from 'lucide-react'
|
||||
import { InlineAlert } from '../components/ui/InlineAlert'
|
||||
import { socialInsuranceApi, commercialInsuranceApi } from '../lib/api-services'
|
||||
import { get as apiGet, post as apiPost, put as apiPut, del as apiDel } from '../lib/api-services-raw'
|
||||
import { useAuthStore } from '../store/authStore'
|
||||
import Card from '../components/ui/Card'
|
||||
import Button from '../components/ui/Button'
|
||||
@@ -119,16 +118,16 @@ export default function SocialInsurance() {
|
||||
const { mutateAsync: fetchMonthlyChanges, isPending: monthlyLoading, data: monthlyChanges } = useMutation<any>({
|
||||
mutationFn: async () => {
|
||||
const [socialRes, housingRes, socialActiveRes, housingActiveRes] = await Promise.all([
|
||||
apiGet('/social/monthly-changes', { params: { month: monthlyMonth } }) as any,
|
||||
apiGet('/social/housing/monthly-changes', { params: { month: monthlyMonth } }) as any,
|
||||
apiGet('/social/active-declaration', { params: { month: monthlyMonth } }) as any,
|
||||
apiGet('/social/housing/active-declaration', { params: { month: monthlyMonth } }) as any,
|
||||
socialInsuranceApi.monthlyChanges(monthlyMonth) as any,
|
||||
socialInsuranceApi.housingMonthlyChanges(monthlyMonth) as any,
|
||||
socialInsuranceApi.activeDeclaration(monthlyMonth) as any,
|
||||
socialInsuranceApi.housingActiveDeclaration(monthlyMonth) as any,
|
||||
])
|
||||
return {
|
||||
social: socialRes.data,
|
||||
housing: housingRes.data,
|
||||
socialActive: socialActiveRes.data,
|
||||
housingActive: housingActiveRes.data,
|
||||
social: socialRes,
|
||||
housing: housingRes,
|
||||
socialActive: socialActiveRes,
|
||||
housingActive: housingActiveRes,
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user