Login.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. <template>
  2. <div :class="prefixCls" class="relative w-full h-full px-4">
  3. <AppLocalePicker
  4. class="absolute top-4 right-4 enter-x text-white xl:text-gray-600"
  5. :showText="false"
  6. />
  7. <span class="-enter-x xl:hidden">
  8. <AppLogo :alwaysShowTitle="true" />
  9. </span>
  10. <div class="container relative h-full py-2 mx-auto sm:px-10">
  11. <div class="flex h-full">
  12. <div class="hidden xl:flex xl:flex-col xl:w-6/12 min-h-full mr-4 pl-4">
  13. <AppLogo class="-enter-x" />
  14. <div class="my-auto">
  15. <img
  16. :alt="title"
  17. src="../../../assets/svg/login-box-bg.svg"
  18. class="w-1/2 -mt-16 -enter-x"
  19. />
  20. <div class="mt-10 font-medium text-white -enter-x">
  21. <span class="mt-4 text-3xl inline-block"> {{ t('sys.login.signInTitle') }}</span>
  22. </div>
  23. <div class="mt-5 text-md text-white font-normal dark:text-gray-500 -enter-x">
  24. {{ t('sys.login.signInDesc') }}
  25. </div>
  26. </div>
  27. </div>
  28. <div class="h-full xl:h-auto flex py-5 xl:py-0 xl:my-0 w-full xl:w-6/12">
  29. <div
  30. class="my-auto mx-auto xl:ml-20 bg-white xl:bg-transparent px-5 py-8 sm:px-8 xl:p-0 rounded-md shadow-md xl:shadow-none w-full sm:w-3/4 lg:w-2/4 xl:w-auto enter-x relative"
  31. >
  32. <LoginForm />
  33. <ForgetPasswordForm />
  34. <RegisterForm />
  35. <MobileForm />
  36. <QrCodeForm />
  37. </div>
  38. </div>
  39. </div>
  40. </div>
  41. </div>
  42. </template>
  43. <script lang="ts">
  44. import { defineComponent, computed } from 'vue';
  45. import { AppLogo } from '/@/components/Application';
  46. import { AppLocalePicker } from '/@/components/Application';
  47. import LoginForm from './LoginForm.vue';
  48. import ForgetPasswordForm from './ForgetPasswordForm.vue';
  49. import RegisterForm from './RegisterForm.vue';
  50. import MobileForm from './MobileForm.vue';
  51. import QrCodeForm from './QrCodeForm.vue';
  52. import { useGlobSetting, useProjectSetting } from '/@/hooks/setting';
  53. import { useI18n } from '/@/hooks/web/useI18n';
  54. import { useDesign } from '/@/hooks/web/useDesign';
  55. export default defineComponent({
  56. name: 'Login',
  57. components: {
  58. AppLogo,
  59. LoginForm,
  60. ForgetPasswordForm,
  61. RegisterForm,
  62. MobileForm,
  63. QrCodeForm,
  64. AppLocalePicker,
  65. },
  66. setup() {
  67. const globSetting = useGlobSetting();
  68. const { prefixCls } = useDesign('login');
  69. const { locale } = useProjectSetting();
  70. const { t } = useI18n();
  71. return {
  72. t,
  73. prefixCls,
  74. title: computed(() => globSetting?.title ?? ''),
  75. showLocale: computed(() => locale.show),
  76. };
  77. },
  78. });
  79. </script>
  80. <style lang="less">
  81. @prefix-cls: ~'@{namespace}-login';
  82. @logo-prefix-cls: ~'@{namespace}-app-logo';
  83. @countdown-prefix-cls: ~'@{namespace}-countdown-input';
  84. .@{prefix-cls} {
  85. @media (max-width: @screen-xl) {
  86. background: linear-gradient(180deg, #1c3faa, #1c3faa);
  87. }
  88. &::before {
  89. position: absolute;
  90. top: 0;
  91. left: 0;
  92. width: 100%;
  93. height: 100%;
  94. margin-left: -48%;
  95. background-image: url(/@/assets/svg/login-bg.svg);
  96. background-position: 100%;
  97. background-repeat: no-repeat;
  98. background-size: auto 100%;
  99. content: '';
  100. @media (max-width: @screen-xl) {
  101. display: none;
  102. }
  103. }
  104. .@{logo-prefix-cls} {
  105. position: absolute;
  106. top: 12px;
  107. height: 30px;
  108. &__title {
  109. font-size: 16px;
  110. color: #fff;
  111. }
  112. img {
  113. width: 32px;
  114. }
  115. }
  116. .container {
  117. .@{logo-prefix-cls} {
  118. display: flex;
  119. width: 60%;
  120. height: 80px;
  121. &__title {
  122. font-size: 24px;
  123. color: #fff;
  124. }
  125. img {
  126. width: 48px;
  127. }
  128. }
  129. }
  130. &-sign-in-way {
  131. .anticon {
  132. font-size: 22px;
  133. color: #888;
  134. cursor: pointer;
  135. &:hover {
  136. color: @primary-color;
  137. }
  138. }
  139. }
  140. input:not([type='checkbox']) {
  141. min-width: 360px;
  142. @media (max-width: @screen-sm) {
  143. min-width: 240px;
  144. }
  145. }
  146. .@{countdown-prefix-cls} input {
  147. min-width: unset;
  148. }
  149. .ant-divider-inner-text {
  150. font-size: 12px;
  151. color: @text-color-secondary;
  152. }
  153. }
  154. </style>