This commit is contained in:
zlwu committed 2026-08-09 19:42:32 +08:00
1 parent 47ef575524
commit 38383b35d9
92 files changed
+1051117 -37355

No files matched your search

+6 -1
View File
@@ -11,8 +11,13 @@ export class BizError extends Error {
}
}
/**
* FastAPI 以 @router.get("/") + prefix 注册的集合根须带尾斜杠,否则 307 会丢 Authorization。
* 发票夹路由是无尾斜杠的 /invoices、/invoice-ledgers、/invoice-wallets,切勿追加 `/`。
* 与 web-admin/src/utils/http/bx.ts 保持一致。
*/
const BX_COLLECTION_ROOT =
/^\/(reimburses|advances|payments|workflows|expense-items|invoices|invoice-wallets|invoice-ledgers)$/
/^\/(reimburses|advances|payments|workflows|expense-items)$/
function normalizeBxUrl(url?: string): string | undefined {
if (!url || url.endsWith('/')) return url
+4
View File
@@ -27,6 +27,7 @@ export const advanceApi = {
myStats: () => bxClient.get('/advances/my/stats'),
pendingApproval: (params?: Record<string, any>) =>
bxClient.get('/advances/pending-approval', { params }),
pendingApprovalStats: () => bxClient.get('/advances/pending-approval/stats'),
approvedByMe: (params?: Record<string, any>) =>
bxClient.get('/advances/approved-by-me', { params }),
getById: (id: BxId) => bxClient.get(`/advances/${id}`),
@@ -59,6 +60,7 @@ export const reimburseApi = {
myStats: () => bxClient.get('/reimburses/my/stats'),
pendingApproval: (params?: Record<string, any>) =>
bxClient.get('/reimburses/pending-approval', { params }),
pendingApprovalStats: () => bxClient.get('/reimburses/pending-approval/stats'),
approvedByMe: (params?: Record<string, any>) =>
bxClient.get('/reimburses/approved-by-me', { params }),
getById: (id: BxId) => bxClient.get(`/reimburses/${id}`),
@@ -92,6 +94,8 @@ export const invoiceApi = {
}
export const paymentApi = {
financeStats: () => bxClient.get('/payments/stats'),
advanceIssueStats: () => bxClient.get('/payments/advance-issues/stats'),
pending: (params?: Record<string, any>) => bxClient.get('/payments/pending', { params }),
pay: (id: BxId, data?: { payRemark?: string; actualAmount?: number }) =>
bxClient.post(`/payments/${id}/pay`, data),