ruoyi-plus-vben5/packages/effects/common-ui/src/authentication/login-expired-modal.vue

63 lines
1.6 KiB
Vue
Raw Normal View History

<script setup lang="ts">
import { useForwardPropsEmits } from '@vben-core/hooks';
import {
Dialog,
DialogContent,
DialogDescription,
DialogTitle,
2024-07-18 21:31:34 +08:00
VbenAvatar,
VisuallyHidden,
} from '@vben-core/shadcn-ui';
import AuthenticationLogin from './login.vue';
import { AuthenticationProps, LoginAndRegisterParams } from './typings';
2024-07-18 21:31:34 +08:00
interface Props extends AuthenticationProps {
avatar?: string;
}
defineOptions({
name: 'LoginExpiredModal',
});
2024-07-18 21:31:34 +08:00
const props = withDefaults(defineProps<Props>(), {
avatar: '',
});
const emit = defineEmits<{
submit: [LoginAndRegisterParams];
}>();
const open = defineModel<boolean>('open');
const forwarded = useForwardPropsEmits(props, emit);
</script>
<template>
<div>
<Dialog v-model:open="open">
<DialogContent
:show-close="false"
class="top-1/2 h-full w-full translate-y-[-50%] border-none p-4 py-12 text-center shadow-xl sm:w-[600px] sm:rounded-2xl md:h-[unset] md:px-14 md:pt-12"
@escape-key-down="(e) => e.preventDefault()"
@interact-outside="(e) => e.preventDefault()"
>
2024-07-18 21:31:34 +08:00
<DialogTitle>
<VbenAvatar :src="avatar" class="mx-auto size-20" />
</DialogTitle>
<VisuallyHidden>
<DialogDescription />
</VisuallyHidden>
<AuthenticationLogin
v-bind="forwarded"
:show-forget-password="false"
:show-register="false"
:show-remember-me="false"
:sub-title="$t('authentication.loginAgainSubTitle')"
:title="$t('authentication.loginAgainTitle')"
/>
</DialogContent>
</Dialog>
</div>
</template>