优化
This commit is contained in:
+3
-1
@@ -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))) {
|
||||
|
||||
Reference in New Issue
Block a user