mirror of
https://github.com/pure-admin/vue-pure-admin.git
synced 2026-02-19 17:40:26 +08:00
refactor: 重构API接口响应格式,带来简洁高效的接口设计 (#1256)
This commit is contained in:
@@ -38,12 +38,14 @@ const dataLoading = ref(true);
|
||||
|
||||
const getCardListData = async () => {
|
||||
try {
|
||||
const { data } = await getCardList();
|
||||
productList.value = data.list;
|
||||
pagination.value = {
|
||||
...pagination.value,
|
||||
total: data.list.length
|
||||
};
|
||||
const { code, data } = await getCardList();
|
||||
if (code === 0) {
|
||||
productList.value = data.list;
|
||||
pagination.value = {
|
||||
...pagination.value,
|
||||
total: data.list.length
|
||||
};
|
||||
}
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
} finally {
|
||||
|
||||
Reference in New Issue
Block a user