2024-07-11 20:11:11 +08:00
|
|
|
<script setup lang="ts">
|
2024-07-14 16:28:56 +08:00
|
|
|
import { useForwardPropsEmits } from '@vben-core/hooks';
|
2024-07-11 20:11:11 +08:00
|
|
|
import {
|
|
|
|
Dialog,
|
|
|
|
DialogContent,
|
|
|
|
DialogDescription,
|
|
|
|
DialogTitle,
|
2024-07-18 21:31:34 +08:00
|
|
|
VbenAvatar,
|
2024-07-11 20:11:11 +08:00
|
|
|
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;
|
|
|
|
}
|
2024-07-11 20:11:11 +08:00
|
|
|
|
|
|
|
defineOptions({
|
|
|
|
name: 'LoginExpiredModal',
|
|
|
|
});
|
|
|
|
|
2024-07-18 21:31:34 +08:00
|
|
|
const props = withDefaults(defineProps<Props>(), {
|
|
|
|
avatar: '',
|
|
|
|
});
|
2024-07-11 20:11:11 +08:00
|
|
|
|
|
|
|
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>
|
2024-07-11 20:11:11 +08:00
|
|
|
<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>
|