fix: 清理死代码 + 修复群组模式预算支出计算

- 清理 store 中未使用的 loading 状态(stats/budget/category/user)
- 清理 stats store 冗余类型重导出和 catch 重置逻辑
- 清理 transaction store 未使用的 currentPage
- 清理 api/group 未使用的 GroupDetail/GroupMember/getGroupDetail
- 删除无引用的 api/index.ts barrel 导出文件
- 删除后端未调用的 GET /groups/:id 群组详情路由
- 合并 stats 页面重复的 loadTabData 函数
- 修复预算页群组模式下只算个人支出(不传 group_id)
This commit is contained in:
wangxiaogang
2026-06-04 21:04:59 +08:00
parent e764ae996e
commit 114263e4b2
10 changed files with 56 additions and 182 deletions

View File

@@ -12,21 +12,6 @@ export interface Group {
member_count: number
}
/** 群组详情(含成员) */
export interface GroupDetail extends Group {
members: GroupMember[]
}
/** 群组成员 */
export interface GroupMember {
user_id: number
role: 'owner' | 'member'
nickname: string
user_nickname: string
avatar_url: string
joined_at: string
}
/** 创建群组 */
export function createGroup(data: { name: string }) {
return request<{ id: number; invite_code: string }>({ url: '/groups', method: 'POST', data })
@@ -37,11 +22,6 @@ export function getGroups() {
return request<Group[]>({ url: '/groups' })
}
/** 获取群组详情 */
export function getGroupDetail(id: number) {
return request<GroupDetail>({ url: `/groups/${id}` })
}
/** 加入群组 */
export function joinGroup(invite_code: string) {
return request<{ group_id: number; name: string }>({ url: '/groups/join', method: 'POST', data: { invite_code } })

View File

@@ -1,5 +0,0 @@
export * from './auth'
export * from './transaction'
export * from './category'
export * from './budget'
export * from './stats'