feat: 修改网点api地址以及回填内容
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
import request from '@/sheep/request';
|
||||
|
||||
function normalizeList(data) {
|
||||
if (Array.isArray(data)) {
|
||||
return data;
|
||||
}
|
||||
if (Array.isArray(data?.list)) {
|
||||
return data.list;
|
||||
}
|
||||
if (Array.isArray(data?.records)) {
|
||||
return data.records;
|
||||
}
|
||||
return [];
|
||||
}
|
||||
|
||||
const StoreApi = {
|
||||
getStoreListByLocation: async (params) => {
|
||||
const res = await request({
|
||||
url: '/trade/store/list-by-location',
|
||||
method: 'GET',
|
||||
params,
|
||||
custom: {
|
||||
showLoading: false,
|
||||
showError: false,
|
||||
},
|
||||
});
|
||||
if (res?.code === 0) {
|
||||
res.data = normalizeList(res.data);
|
||||
}
|
||||
return res;
|
||||
},
|
||||
};
|
||||
|
||||
export default StoreApi;
|
||||
Reference in New Issue
Block a user