fix webpush仅限管理员

This commit is contained in:
jxxghp
2024-06-08 12:35:05 +08:00
parent 9d3f4879ef
commit e34573e72f
2 changed files with 4 additions and 4 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "moviepilot",
"version": "1.9.4-2",
"version": "1.9.4",
"private": true,
"bin": "dist/service.js",
"scripts": {

View File

@@ -116,13 +116,13 @@ async function subscribeForPushNotifications() {
}
// 登录后处理
async function afterLogin() {
async function afterLogin(superuser: boolean) {
// 生效主题配置
await setTheme()
// 跳转到首页或回原始页面
router.push(store.state.auth.originalPath ?? '/')
// 订阅推送通知
await subscribeForPushNotifications()
if (superuser) await subscribeForPushNotifications()
}
// 登录获取token事件
@@ -163,7 +163,7 @@ function login() {
store.dispatch('auth/updateAvatar', avatar)
// 登录后处理
afterLogin()
afterLogin(superuser)
})
.catch((error: any) => {
// 登录失败,显示错误提示