添加 刷新通讯录功能,用于解决冗余数据问题。

This commit is contained in:
liuwei
2025-05-07 11:38:45 +08:00
parent 9a2d9f3f12
commit 19d56afc8d
5 changed files with 175 additions and 8 deletions

View File

@@ -17,6 +17,13 @@
{% raw %}@click="refreshContacts"{% endraw %}>
刷新数据
</el-button>
<el-button
type="success"
size="small"
style="float: right; margin-left: 10px;"
{% raw %}@click="updateContacts"{% endraw %}>
更新通讯录
</el-button>
<el-input
placeholder="搜索联系人..."
{% raw %}v-model="searchQuery"{% endraw %}
@@ -631,7 +638,22 @@
handleGroupMembersCurrentChange(page) {
this.groupMembersCurrentPage = page;
}
}
},
updateContacts() {
this.$message.info('正在更新通讯录...');
axios.post('/api/contacts/update')
.then(res => {
if (res.data.success) {
this.$message.success('通讯录更新成功!');
this.refreshContacts();
} else {
this.$message.error(res.data.message || '通讯录更新失败');
}
})
.catch(() => {
this.$message.error('通讯录更新请求失败');
});
},
});
</script>