修复货位列表:Bearer前缀+响应格式兼容

This commit is contained in:
97694732@qq.com 2026-06-03 17:55:20 +08:00
parent 83e2d0103b
commit ce5b63fcc1
2 changed files with 14 additions and 8 deletions

View File

@ -1149,18 +1149,24 @@ export default {
warehouse_id: warehouseId, type: 1, status: 1,
page: 1, page_size: 999
})
if (res.code === 0 && res.data && res.data.list) {
this.popupLocationList = res.data.list
this.popupAllLocationList = res.data.list
const total = res.data.total || 0
this.popupLocHasMore = this.popupLocPage * this.popupLocPageSize < total
} else {
const list = Array.isArray(res.data) ? res.data : []
console.log('【货位列表】load响应:', JSON.stringify(res))
//
let list = []
if (res.code === 0 && res.data) {
list = res.data.list || res.data.records || []
}
if (list.length === 0) {
list = res.list || res.records || []
}
if (list.length > 0) {
this.popupLocationList = list
this.popupAllLocationList = list
this.popupLocHasMore = false
} else {
console.warn('货位列表为空', JSON.stringify(res))
}
} catch (e) {
console.error('加载货位失败:', e)
this.popupLocationList = this.popupAllLocationList
this.popupLocHasMore = false
} finally {

View File

@ -190,7 +190,7 @@ export function getLocationList(params = {}) {
url: url,
method: 'GET',
header: {
'Authorization': locToken
'Authorization': 'Bearer ' + locToken
},
success: (res) => {
console.log('【货位列表】响应状态码:', res.statusCode)