mirror of
https://github.com/ZeroCatDev/Classworks.git
synced 2025-12-08 22:03:09 +00:00
Compare commits
No commits in common. "a5cd6bcd084fa12de1128ee55c41f354dab1ae1b" and "0ac7f6e6b19a14eb7850cc0e5bdcf02732ee335d" have entirely different histories.
a5cd6bcd08
...
0ac7f6e6b1
@ -681,9 +681,7 @@ export default {
|
||||
|
||||
try {
|
||||
this.persistentNotifications = this.persistentNotifications.filter(n => n.id !== id)
|
||||
// 当通知列表为空时,保存空对象 {} 而不是空数组 [],因为后端不接受空数组
|
||||
const dataToSave = this.persistentNotifications.length > 0 ? this.persistentNotifications : {}
|
||||
await dataProvider.saveData('notification-list', dataToSave)
|
||||
await dataProvider.saveData('notification-list', this.persistentNotifications)
|
||||
this.$message?.success('已删除')
|
||||
} catch (e) {
|
||||
console.error('删除失败', e)
|
||||
|
||||
@ -2066,9 +2066,7 @@ export default {
|
||||
},
|
||||
async removePersistentNotification(id) {
|
||||
this.persistentNotifications = this.persistentNotifications.filter(n => n.id !== id);
|
||||
// 当通知列表为空时,保存空对象 {} 而不是空数组 [],因为后端不接受空数组
|
||||
const dataToSave = this.persistentNotifications.length > 0 ? this.persistentNotifications : {};
|
||||
await dataProvider.saveData('notification-list', dataToSave);
|
||||
await dataProvider.saveData('notification-list', this.persistentNotifications);
|
||||
this.notificationDetailDialog = false;
|
||||
},
|
||||
},
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user