mirror of
https://github.com/ZeroCatDev/Classworks.git
synced 2025-12-07 13:03:59 +00:00
Compare commits
5 Commits
0ac7f6e6b1
...
a5cd6bcd08
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a5cd6bcd08 | ||
|
|
f282f1f4bc | ||
|
|
5ee4602181 | ||
|
|
056225b6b3 | ||
|
|
65b08653c8 |
@ -681,7 +681,9 @@ export default {
|
||||
|
||||
try {
|
||||
this.persistentNotifications = this.persistentNotifications.filter(n => n.id !== id)
|
||||
await dataProvider.saveData('notification-list', this.persistentNotifications)
|
||||
// 当通知列表为空时,保存空对象 {} 而不是空数组 [],因为后端不接受空数组
|
||||
const dataToSave = this.persistentNotifications.length > 0 ? this.persistentNotifications : {}
|
||||
await dataProvider.saveData('notification-list', dataToSave)
|
||||
this.$message?.success('已删除')
|
||||
} catch (e) {
|
||||
console.error('删除失败', e)
|
||||
|
||||
@ -2066,7 +2066,9 @@ export default {
|
||||
},
|
||||
async removePersistentNotification(id) {
|
||||
this.persistentNotifications = this.persistentNotifications.filter(n => n.id !== id);
|
||||
await dataProvider.saveData('notification-list', this.persistentNotifications);
|
||||
// 当通知列表为空时,保存空对象 {} 而不是空数组 [],因为后端不接受空数组
|
||||
const dataToSave = this.persistentNotifications.length > 0 ? this.persistentNotifications : {};
|
||||
await dataProvider.saveData('notification-list', dataToSave);
|
||||
this.notificationDetailDialog = false;
|
||||
},
|
||||
},
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user