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:
selfrelease
2026-08-01 16:20:28 +08:00
parent 16f22e6622
commit a252d72e68
6 changed files with 47 additions and 22 deletions
+30
View File
@@ -219,6 +219,18 @@ export const dashboardApi = {
/** 年度价值报告保存 */
annualValueSave: (year: number) =>
post('/dashboard/annual-value/save', { year }).then(unwrap<any>()),
/** 待办标记已处理 */
resolveTodo: (id: string) =>
patch(`/dashboard/todos/${id}/resolve`),
/** 待办忽略 */
ignoreTodo: (id: string) =>
patch(`/dashboard/todos/${id}/ignore`),
/** 批量标记已处理 */
batchResolveTodos: (ids: string[]) =>
patch('/dashboard/todos/batch-resolve', { ids }),
/** 批量忽略 */
batchIgnoreTodos: (ids: string[]) =>
patch('/dashboard/todos/batch-ignore', { ids }),
}
// ========== 考勤相关 ==========
@@ -511,6 +523,15 @@ export const socialInsuranceApi = {
/** 社保/公积金记录更正 */
correctRecord: (type: 'social' | 'housing', id: string, data: any) =>
put(`/social/records/${type}/${id}/correct`, data).then(unwrap<any>()),
/** 社保月度变动 */
monthlyChanges: (month: string) =>
get('/social/monthly-changes', { params: { month } }).then(unwrap<any>()),
/** 公积金月度变动 */
housingMonthlyChanges: (month: string) =>
get('/social/housing/monthly-changes', { params: { month } }).then(unwrap<any>()),
/** 公积金活跃申报 */
housingActiveDeclaration: (month: string) =>
get('/social/housing/active-declaration', { params: { month } }).then(unwrap<any>()),
}
// ========== 商业保险 ==========
@@ -665,6 +686,12 @@ export const notificationsApi = {
/** 更新通知设置 */
updateSettings: (data: any) =>
put('/notifications/settings', data),
/** 检查合同到期 */
checkContracts: () =>
post('/notifications/check-contracts'),
/** 测试通知发送 */
test: (channel: 'wechat' | 'email') =>
post('/notifications/test', { channel }),
}
// ========== 系统设置 ==========
@@ -697,6 +724,9 @@ export const settingsApi = {
/** 退休政策 */
retirementPolicy: () =>
get('/settings/retirement-policy').then(unwrap<any>()),
/** 确认退休政策生效 */
confirmRetirementPolicy: (id: string) =>
post(`/settings/retirement-policy/${id}/confirm`),
}
// ========== 模板相关 ==========