Login.vue 4.9 KB

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