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