This commit is contained in:
2026-09-11 11:52:44 +08:00
parent 138ab6405a
commit cc94755035
3 changed files with 5 additions and 2 deletions
+3 -1
View File
@@ -1,4 +1,5 @@
import { apiDownload, apiRequest } from '@/api/http.js'
import { session } from '@/stores/session.js'
const ROOT = '/first-leg/pda-dropship'
@@ -48,7 +49,8 @@ export function sealDropshipPallet(taskId, warehouseId, pallet) {
}
export function downloadDropshipPalletLabel(taskId, warehouseId, palletId) {
const url = `${ROOT}/tasks/${encodeURIComponent(taskId)}/pallets/${encodeURIComponent(palletId)}/print?warehouseId=${encodeURIComponent(stableId(warehouseId))}`
const baseUrl = String(session.apiBase || '/api/platform/v1').replace(/\/$/, '')
const url = `${baseUrl}${ROOT}/tasks/${encodeURIComponent(taskId)}/pallets/${encodeURIComponent(palletId)}/print?warehouseId=${encodeURIComponent(stableId(warehouseId))}`
return apiDownload({ url }).then((response) => {
const contentType = response.header?.['Content-Type'] || response.header?.['content-type'] || ''
if (response.statusCode < 200 || response.statusCode >= 300 || !response.tempFilePath || (contentType && !/^application\/pdf/i.test(contentType))) {