app
This commit is contained in:
1 parent
be842cc1d5
commit
9a75589282
13 files changed
+1119
-43
No files matched your search
@@ -0,0 +1,17 @@
|
||||
import type { Router } from 'vue-router'
|
||||
|
||||
let router: Router | null = null
|
||||
|
||||
export function setRouter(r: Router): void {
|
||||
router = r
|
||||
}
|
||||
|
||||
export function goLogin(redirect: string): void {
|
||||
if (router) {
|
||||
router.push({ name: 'login', query: { redirect } })
|
||||
} else {
|
||||
window.location.assign(
|
||||
`/?redirect=${encodeURIComponent(redirect)}#/login`,
|
||||
)
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user