- 修复路由守卫:未登录时直接跳转,不显示提示信息 - 修复API拦截器:401错误直接跳转,无需确认 - 移除不必要的ElMessageBox确认框 - 优化Token过期处理逻辑 - 修复文件管理API引入路径和URL前缀 - 修复调拨/回收管理API端点不匹配问题 - 修复通知管理API方法不匹配问题 - 统一系统配置API路径为单数形式 影响文件: - src/router/index.ts - src/api/request.ts - src/api/file.ts - src/api/index.ts 测试状态: - 前端构建通过 - 所有API路径已验证 - 登录流程测试通过 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
62 lines
1.4 KiB
TypeScript
62 lines
1.4 KiB
TypeScript
/**
|
|
* 机构网点管理 API
|
|
*/
|
|
import { request } from './request'
|
|
import type { Organization } from '@/types'
|
|
|
|
/** 创建机构参数 */
|
|
export interface OrganizationCreateParams {
|
|
orgCode: string
|
|
orgName: string
|
|
orgType: Organization['orgType']
|
|
parentId?: number
|
|
address?: string
|
|
contactPerson?: string
|
|
contactPhone?: string
|
|
}
|
|
|
|
/** 更新机构参数 */
|
|
export type OrganizationUpdateParams = Partial<Omit<OrganizationCreateParams, 'orgCode'>>
|
|
|
|
/**
|
|
* 获取机构树
|
|
*/
|
|
export const getOrganizationTree = () => {
|
|
return request.get<Organization[]>('/organizations/tree')
|
|
}
|
|
|
|
/**
|
|
* 获取机构详情
|
|
*/
|
|
export const getOrganizationById = (id: number) => {
|
|
return request.get<Organization>(`/organizations/${id}`)
|
|
}
|
|
|
|
/**
|
|
* 创建机构
|
|
*/
|
|
export const createOrganization = (data: OrganizationCreateParams) => {
|
|
return request.post<Organization>('/organizations', data)
|
|
}
|
|
|
|
/**
|
|
* 更新机构
|
|
*/
|
|
export const updateOrganization = (id: number, data: OrganizationUpdateParams) => {
|
|
return request.put(`/organizations/${id}`, data)
|
|
}
|
|
|
|
/**
|
|
* 删除机构
|
|
*/
|
|
export const deleteOrganization = (id: number) => {
|
|
return request.delete(`/organizations/${id}`)
|
|
}
|
|
|
|
/**
|
|
* 移动机构(调整层级)
|
|
*/
|
|
export const moveOrganization = (id: number, targetParentId: number | null) => {
|
|
return request.put(`/organizations/${id}/move`, { target_parent_id: targetParentId })
|
|
}
|