增加一次性群邀请链接和二维码

This commit is contained in:
xhgit committed 2026-11-15 18:02:28 +08:00
1 parent dfeb5bfefa
commit 5ec9c81f90
18 files changed
+727 -14

No files matched your search

+5
View File
@@ -9,6 +9,7 @@ import ChatView from './views/ChatView.vue'
import GroupView from './views/GroupView.vue'
import Workspace from './views/Workspace.vue'
import { useSession } from './session'
import { incomingGroupInvite, parseGroupInvite } from './chat/group-invites'
import './style.css'
const pinia = createPinia()
@@ -29,6 +30,10 @@ const router = createRouter({
router.beforeEach((to) => {
const signedIn = Boolean(useSession(pinia).identity)
if (to.path === '/groups' && typeof to.query.invite === 'string') {
incomingGroupInvite.value = parseGroupInvite(to.query.invite)
return { path: signedIn ? '/groups' : '/login', replace: true }
}
if (!signedIn && to.path !== '/login') return '/login'
if (signedIn && to.path === '/login') return '/devices'
})