forked from FoundKeyGang/FoundKey
client: refactor pleaseLogin to pleaseLoginOrPage
This commit is contained in:
parent
559a17cf26
commit
5a263ec2c3
2 changed files with 3 additions and 3 deletions
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
import { EventEmitter } from 'eventemitter3';
|
import { EventEmitter } from 'eventemitter3';
|
||||||
import { Component, shallowRef, ShallowRef } from 'vue';
|
import { Component, shallowRef, ShallowRef } from 'vue';
|
||||||
import { pleaseLogin } from '@/scripts/please-login';
|
import { pleaseLoginOrPage } from '@/scripts/please-login';
|
||||||
import { safeURIDecode } from '@/scripts/safe-uri-decode';
|
import { safeURIDecode } from '@/scripts/safe-uri-decode';
|
||||||
|
|
||||||
type RouteDef = {
|
type RouteDef = {
|
||||||
|
@ -174,7 +174,7 @@ export class Router extends EventEmitter<{
|
||||||
}
|
}
|
||||||
|
|
||||||
if (res.route.loginRequired) {
|
if (res.route.loginRequired) {
|
||||||
pleaseLogin('/');
|
pleaseLoginOrPage('/');
|
||||||
}
|
}
|
||||||
|
|
||||||
const isSamePath = beforePath === path;
|
const isSamePath = beforePath === path;
|
||||||
|
|
|
@ -3,7 +3,7 @@ import { $i } from '@/account';
|
||||||
import { i18n } from '@/i18n';
|
import { i18n } from '@/i18n';
|
||||||
import { popup } from '@/os';
|
import { popup } from '@/os';
|
||||||
|
|
||||||
export function pleaseLogin(path?: string) {
|
export function pleaseLoginOrPage(path?: string) {
|
||||||
if ($i) return;
|
if ($i) return;
|
||||||
|
|
||||||
popup(defineAsyncComponent(() => import('@/components/signin-dialog.vue')), {
|
popup(defineAsyncComponent(() => import('@/components/signin-dialog.vue')), {
|
||||||
|
|
Loading…
Reference in a new issue