add webpush switch

This commit is contained in:
jxxghp
2024-06-05 18:42:39 +08:00
parent 157c37c862
commit e649be58a2
3 changed files with 14 additions and 1 deletions

View File

@@ -107,7 +107,11 @@ async function subscribeForPushNotifications() {
}
})
// 发送订阅请求
await api.post('/message/subscribe', subscription)
try {
await api.post('/message/webpush/subscribe', subscription)
} catch (e) {
console.log(e)
}
}
}