Login.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  1. <template>
  2. <div :class="prefixCls" class="relative w-full h-full px-4">
  3. <AppDarkModeToggle class="absolute top-3 right-7 enter-x" v-if="!sessionTimeout" />
  4. <span class="-enter-x xl:hidden">
  5. <AppLogo :alwaysShowTitle="true" />
  6. </span>
  7. <div class="container relative h-full py-2 mx-auto sm:px-10">
  8. <div class="flex h-full">
  9. <div class="hidden min-h-full pl-4 mr-4 xl:flex xl:flex-col xl:w-6/12">
  10. <AppLogo class="-enter-x" />
  11. <div class="my-auto">
  12. <img :alt="title" src="../../../assets/svg/login-box-bg.svg" class="w-1/2 -mt-16 -enter-x" />
  13. <div class="mt-10 font-medium text-white -enter-x">
  14. <span class="inline-block mt-4 text-3xl"> {{ t('sys.login.signInTitle') }}</span>
  15. </div>
  16. <div class="mt-5 font-normal text-white text-md dark:text-gray-500 -enter-x">
  17. {{ t('sys.login.signInDesc') }}
  18. </div>
  19. </div>
  20. </div>
  21. <div class="flex w-full h-full py-5 xl:h-auto xl:py-0 xl:my-0 xl:w-6/12">
  22. <div
  23. :class="`${prefixCls}-form`"
  24. class="relative w-full px-5 py-8 mx-auto my-auto rounded-md shadow-md xl:ml-16 xl:bg-transparent sm:px-8 xl:p-4 xl:shadow-none sm:w-3/4 lg:w-2/4 xl:w-auto enter-x"
  25. >
  26. <LoginForm />
  27. <ForgetPasswordForm />
  28. <RegisterForm />
  29. <MobileForm />
  30. <QrCodeForm />
  31. </div>
  32. </div>
  33. </div>
  34. </div>
  35. </div>
  36. </template>
  37. <script lang="ts" setup>
  38. import { computed } from 'vue';
  39. import { AppLogo } from '/@/components/Application';
  40. import { AppDarkModeToggle } from '/@/components/Application';
  41. import LoginForm from './LoginForm.vue';
  42. import ForgetPasswordForm from './ForgetPasswordForm.vue';
  43. import RegisterForm from './RegisterForm.vue';
  44. import MobileForm from './MobileForm.vue';
  45. import QrCodeForm from './QrCodeForm.vue';
  46. import { useGlobSetting } from '/@/hooks/setting';
  47. import { useI18n } from '/@/hooks/web/useI18n';
  48. import { useDesign } from '/@/hooks/web/useDesign';
  49. import { useLocaleStore } from '/@/store/modules/locale';
  50. import { useLoginState, LoginStateEnum } from './useLogin';
  51. defineProps({
  52. sessionTimeout: {
  53. type: Boolean,
  54. },
  55. });
  56. const globSetting = useGlobSetting();
  57. const { prefixCls } = useDesign('login');
  58. const { t } = useI18n();
  59. const localeStore = useLocaleStore();
  60. const showLocale = localeStore.getShowPicker;
  61. const title = computed(() => globSetting?.title ?? '');
  62. const { handleBackLogin } = useLoginState();
  63. handleBackLogin();
  64. </script>
  65. <style lang="less">
  66. @prefix-cls: ~'@{namespace}-login';
  67. @logo-prefix-cls: ~'@{namespace}-app-logo';
  68. @countdown-prefix-cls: ~'@{namespace}-countdown-input';
  69. @dark-bg: #293146;
  70. html[data-theme='dark'] {
  71. .@{prefix-cls} {
  72. background-color: @dark-bg;
  73. &::before {
  74. background-image: url(/@/assets/svg/login-bg-dark.svg);
  75. }
  76. .ant-input,
  77. .ant-input-password {
  78. background-color: #232a3b;
  79. }
  80. .ant-btn:not(.ant-btn-link):not(.ant-btn-primary) {
  81. border: 1px solid #4a5569;
  82. }
  83. &-form {
  84. background: transparent !important;
  85. }
  86. .app-iconify {
  87. color: #fff;
  88. }
  89. }
  90. input.fix-auto-fill,
  91. .fix-auto-fill input {
  92. -webkit-text-fill-color: #c9d1d9 !important;
  93. box-shadow: inherit !important;
  94. }
  95. }
  96. .@{prefix-cls} {
  97. min-height: 100%;
  98. overflow: hidden;
  99. @media (max-width: @screen-xl) {
  100. background-color: #293146;
  101. .@{prefix-cls}-form {
  102. background-color: #fff;
  103. }
  104. }
  105. &::before {
  106. position: absolute;
  107. top: 0;
  108. left: 0;
  109. width: 100%;
  110. height: 100%;
  111. margin-left: -48%;
  112. background-image: url(/@/assets/svg/login-bg.svg);
  113. background-position: 100%;
  114. background-repeat: no-repeat;
  115. background-size: auto 100%;
  116. content: '';
  117. @media (max-width: @screen-xl) {
  118. display: none;
  119. }
  120. }
  121. .@{logo-prefix-cls} {
  122. position: absolute;
  123. top: 12px;
  124. height: 30px;
  125. &__title {
  126. font-size: 16px;
  127. color: #fff;
  128. }
  129. img {
  130. width: 32px;
  131. }
  132. }
  133. .container {
  134. .@{logo-prefix-cls} {
  135. display: flex;
  136. width: 60%;
  137. height: 80px;
  138. &__title {
  139. font-size: 24px;
  140. color: #fff;
  141. }
  142. img {
  143. width: 48px;
  144. }
  145. }
  146. }
  147. &-sign-in-way {
  148. .anticon {
  149. font-size: 22px;
  150. color: #888;
  151. cursor: pointer;
  152. &:hover {
  153. color: @primary-color;
  154. }
  155. }
  156. }
  157. input:not([type='checkbox']) {
  158. min-width: 360px;
  159. @media (max-width: @screen-xl) {
  160. min-width: 320px;
  161. }
  162. @media (max-width: @screen-lg) {
  163. min-width: 260px;
  164. }
  165. @media (max-width: @screen-md) {
  166. min-width: 240px;
  167. }
  168. @media (max-width: @screen-sm) {
  169. min-width: 160px;
  170. }
  171. }
  172. .@{countdown-prefix-cls} input {
  173. min-width: unset;
  174. }
  175. .ant-divider-inner-text {
  176. font-size: 12px;
  177. color: @text-color-secondary;
  178. }
  179. }
  180. </style>