将通讯录刷新与头像缓存同步改为异步处理
This commit is contained in:
@@ -964,7 +964,11 @@
|
||||
},
|
||||
updateContacts() {
|
||||
this.$message.info('正在更新通讯录...');
|
||||
axios.post('/contacts/api/update').then(res => { if (res.data.success) { this.$message.success('通讯录更新成功!'); this.refreshContacts(); } else { this.$message.error(res.data.message || '通讯录更新失败'); } }).catch(() => { this.$message.error('通讯录更新请求失败'); });
|
||||
// 通讯录刷新已改成后台异步任务:
|
||||
// 1. 点击后只提交任务,不再阻塞等待全部联系人与头像同步完成;
|
||||
// 2. 因为结果是异步落库,这里不再立刻 refreshContacts,避免用户误以为没生效;
|
||||
// 3. 任务完成后用户手动点“刷新数据”即可看到最新结果。
|
||||
axios.post('/contacts/api/update').then(res => { if (res.data.success) { this.$message.success(res.data.message || '通讯录更新任务已提交'); } else { this.$message.error(res.data.message || '通讯录更新失败'); } }).catch(() => { this.$message.error('通讯录更新请求失败'); });
|
||||
},
|
||||
refreshContacts() { this.loadContactsData(); this.$message.success('联系人数据已刷新'); },
|
||||
handleTabClick() { this.currentPage = 1; },
|
||||
|
||||
Reference in New Issue
Block a user