mirror of
https://github.com/vbenjs/vue-vben-admin.git
synced 2025-08-26 08:36:19 +08:00
feat: login dialog (#37)
* chore: login-dialog demo * Merge branch 'main' into login-dialog * chore: update dialog * Merge branch 'main' into login-dialog * chore: accept login params * chore: redirect to login or show login dialog
This commit is contained in:
@@ -1,12 +1,16 @@
|
||||
<script lang="ts" setup>
|
||||
import type { NotificationItem } from '@vben/layouts';
|
||||
|
||||
import { computed, ref } from 'vue';
|
||||
import { computed, ref, toRefs } from 'vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
|
||||
import { LOGIN_PATH } from '@vben/constants';
|
||||
import { IcRoundCreditScore, MdiDriveDocument, MdiGithub } from '@vben/icons';
|
||||
import { BasicLayout, Notification, UserDropdown } from '@vben/layouts';
|
||||
import {
|
||||
BasicLayout,
|
||||
LoginDialog,
|
||||
Notification,
|
||||
NotificationItem,
|
||||
UserDropdown,
|
||||
} from '@vben/layouts';
|
||||
import { openWindow } from '@vben/utils';
|
||||
import { preferences } from '@vben-core/preferences';
|
||||
|
||||
@@ -80,7 +84,8 @@ const menus = computed(() => [
|
||||
]);
|
||||
|
||||
const appStore = useAppStore();
|
||||
const { userInfo } = useAccessStore();
|
||||
const accessStore = useAccessStore();
|
||||
const { showLoginDialog, userInfo } = toRefs(accessStore);
|
||||
const router = useRouter();
|
||||
|
||||
async function handleLogout() {
|
||||
@@ -118,5 +123,13 @@ function handleMakeAll() {
|
||||
@make-all="handleMakeAll"
|
||||
/>
|
||||
</template>
|
||||
<template #dialog>
|
||||
<LoginDialog
|
||||
:open="showLoginDialog"
|
||||
password-placeholder="123456"
|
||||
username-placeholder="vben"
|
||||
@login="accessStore.authLogin"
|
||||
/>
|
||||
</template>
|
||||
</BasicLayout>
|
||||
</template>
|
||||
|
Reference in New Issue
Block a user