rename: client -> frontend
This commit is contained in:
21
packages/frontend/src/scripts/please-login.ts
Normal file
21
packages/frontend/src/scripts/please-login.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import { defineAsyncComponent } from 'vue';
|
||||
import { $i } from '@/account';
|
||||
import { i18n } from '@/i18n';
|
||||
import { popup } from '@/os';
|
||||
|
||||
export function pleaseLogin(path?: string) {
|
||||
if ($i) return;
|
||||
|
||||
popup(defineAsyncComponent(() => import('@/components/MkSigninDialog.vue')), {
|
||||
autoSet: true,
|
||||
message: i18n.ts.signinRequired,
|
||||
}, {
|
||||
cancelled: () => {
|
||||
if (path) {
|
||||
window.location.href = path;
|
||||
}
|
||||
},
|
||||
}, 'closed');
|
||||
|
||||
if (!path) throw new Error('signin required');
|
||||
}
|
Reference in New Issue
Block a user