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
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "moviepilot", "name": "moviepilot",
"version": "1.9.4-2", "version": "1.9.4",
"private": true, "private": true,
"bin": "dist/service.js", "bin": "dist/service.js",
"scripts": { "scripts": {
+3 -3
View File
@@ -116,13 +116,13 @@ async function subscribeForPushNotifications() {
} }
// 登录后处理 // 登录后处理
async function afterLogin() { async function afterLogin(superuser: boolean) {
// 生效主题配置 // 生效主题配置
await setTheme() await setTheme()
// 跳转到首页或回原始页面 // 跳转到首页或回原始页面
router.push(store.state.auth.originalPath ?? '/') router.push(store.state.auth.originalPath ?? '/')
// 订阅推送通知 // 订阅推送通知
await subscribeForPushNotifications() if (superuser) await subscribeForPushNotifications()
} }
// 登录获取token事件 // 登录获取token事件
@@ -163,7 +163,7 @@ function login() {
store.dispatch('auth/updateAvatar', avatar) store.dispatch('auth/updateAvatar', avatar)
// 登录后处理 // 登录后处理
afterLogin() afterLogin(superuser)
}) })
.catch((error: any) => { .catch((error: any) => {
// 登录失败,显示错误提示 // 登录失败,显示错误提示