diff --git a/pages/useList/useList.vue b/pages/useList/useList.vue index 2542fbc..c8e8991 100644 --- a/pages/useList/useList.vue +++ b/pages/useList/useList.vue @@ -123,10 +123,7 @@ export default { onLoad() { this.fetchUserList() }, - onShow() { - // 页面显示时刷新数据 - this.fetchUserList() - }, + computed: { filteredUsers() { if (!this.searchKeyword) { @@ -140,7 +137,6 @@ export default { methods: { // 获取用户列表 async fetchUserList() { - this.loading = true try { // 构建查询参数 const params = {} @@ -155,9 +151,9 @@ export default { } const response = await getUserList(params) - if (response.code === 200 && response.data && Array.isArray(response.data)) { + if (response.code === 200 && response.rows && Array.isArray(response.rows)) { // 转换API数据格式为页面需要的格式 - this.users = response.data.map(user => ({ + this.users = response.rows.map(user => ({ ...user, isExpanded: false, // 默认收起 // 将orders转换为devices格式