fix: sanitize bomNo to avoid duplicate path in detail API

Co-authored-by: aider (openai/DeepSeek-V3.2-Thinking) <aider@aider.chat>
This commit is contained in:
dxc
2026-02-28 15:38:02 +08:00
parent fb56359f41
commit 05fbb4e3b3

View File

@ -11,8 +11,11 @@ export function getBomList(params?: any) {
// 获取BOM详情
export function getBomDetail(bomNo: string) {
// 去除首尾斜杠,并按 '/' 分割,取第一个有效部分
const trimmed = bomNo.replace(/^\/+|\/+$/g, '');
const firstPart = trimmed.split('/')[0];
return request({
url: `/v1/bom/detail/${bomNo}`,
url: `/v1/bom/detail/${firstPart}`,
method: 'get'
})
}