Login.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272
  1. <template>
  2. <div :class="prefixCls" class="relative w-full h-full px-4">
  3. <!-- <AppLocalePicker
  4. class="absolute text-white top-4 right-4 enter-x xl:text-gray-600"
  5. :showText="false"
  6. v-if="!sessionTimeout && showLocale"
  7. /> -->
  8. <AppDarkModeToggle class="absolute top-3 right-7 enter-x" v-if="!sessionTimeout" />
  9. <span class="-enter-x xl:hidden">
  10. <AppLogo :alwaysShowTitle="true" />
  11. </span>
  12. <div class="container relative h-full py-2 mx-auto sm:px-10">
  13. <div class="flex h-full">
  14. <div class="hidden min-h-full pl-4 mr-4 xl:flex xl:flex-col xl:w-6/12">
  15. <AppLogo class="-enter-x" />
  16. <div class="my-auto">
  17. <img
  18. :alt="title"
  19. src="../../../assets/svg/login-box-bg.svg"
  20. class="w-1/2 -mt-16 -enter-x"
  21. />
  22. <div class="mt-10 font-medium text-white -enter-x">
  23. <span class="inline-block mt-4 text-3xl"> {{ t('sys.login.signInTitle') }}</span>
  24. </div>
  25. <div class="mt-5 font-normal text-white text-md dark:text-gray-500 -enter-x">
  26. {{ t('sys.login.signInDesc') }}
  27. </div>
  28. <div class="appcode">
  29. <div v-for="item in getAppList" :key="item.name">
  30. <QrCode
  31. :value="item.url"
  32. :options="{ margin: 2 }"
  33. class="enter-x flex justify-center xl:justify-start"
  34. :width="150"
  35. />
  36. <div class="title">
  37. <Icon :icon="item.icon" :size="20" />
  38. {{ item.name }}
  39. </div>
  40. </div>
  41. </div>
  42. </div>
  43. </div>
  44. <div class="flex w-full h-full py-5 xl:h-auto xl:py-0 xl:my-0 xl:w-6/12">
  45. <div
  46. :class="`${prefixCls}-form`"
  47. class="
  48. relative
  49. w-full
  50. px-5
  51. py-8
  52. mx-auto
  53. my-auto
  54. rounded-md
  55. shadow-md
  56. xl:ml-16 xl:bg-transparent
  57. sm:px-8
  58. xl:p-4 xl:shadow-none
  59. sm:w-3/4
  60. lg:w-2/4
  61. xl:w-auto
  62. enter-x
  63. "
  64. >
  65. <LoginForm />
  66. <ForgetPasswordForm />
  67. <RegisterForm />
  68. <MobileForm />
  69. <QrCodeForm />
  70. </div>
  71. </div>
  72. </div>
  73. </div>
  74. </div>
  75. </template>
  76. <script lang="ts" setup>
  77. import { computed } from 'vue';
  78. import { AppLogo } from '/@/components/Application';
  79. import { AppLocalePicker, AppDarkModeToggle } from '/@/components/Application';
  80. import LoginForm from './LoginForm.vue';
  81. import ForgetPasswordForm from './ForgetPasswordForm.vue';
  82. import RegisterForm from './RegisterForm.vue';
  83. import MobileForm from './MobileForm.vue';
  84. import QrCodeForm from './QrCodeForm.vue';
  85. import { QrCode } from '/@/components/Qrcode/index';
  86. import { useGlobSetting } from '/@/hooks/setting';
  87. import { useI18n } from '/@/hooks/web/useI18n';
  88. import { useDesign } from '/@/hooks/web/useDesign';
  89. import { useLocaleStore } from '/@/store/modules/locale';
  90. defineProps({
  91. sessionTimeout: {
  92. type: Boolean,
  93. },
  94. });
  95. const globSetting = useGlobSetting();
  96. const { prefixCls } = useDesign('login');
  97. const { t } = useI18n();
  98. const localeStore = useLocaleStore();
  99. const showLocale = localeStore.getShowPicker;
  100. const { getAppList } = localeStore;
  101. const title = computed(() => globSetting?.title ?? '');
  102. defineExpose({
  103. getAppList,
  104. });
  105. </script>
  106. <style lang="less">
  107. @prefix-cls: ~'@{namespace}-login';
  108. @logo-prefix-cls: ~'@{namespace}-app-logo';
  109. @countdown-prefix-cls: ~'@{namespace}-countdown-input';
  110. @dark-bg: #293146;
  111. html[data-theme='dark'] {
  112. .@{prefix-cls} {
  113. background-color: @dark-bg;
  114. &::before {
  115. background-image: url(/@/assets/svg/login-bg-dark.svg);
  116. }
  117. .ant-input,
  118. .ant-input-password {
  119. background-color: #232a3b;
  120. }
  121. .ant-btn:not(.ant-btn-link):not(.ant-btn-primary) {
  122. border: 1px solid #4a5569;
  123. }
  124. &-form {
  125. background: transparent !important;
  126. }
  127. .app-iconify {
  128. color: #fff;
  129. }
  130. }
  131. input.fix-auto-fill,
  132. .fix-auto-fill input {
  133. -webkit-text-fill-color: #c9d1d9 !important;
  134. box-shadow: inherit !important;
  135. }
  136. }
  137. .@{prefix-cls} {
  138. min-height: 100%;
  139. overflow: hidden;
  140. @media (max-width: @screen-xl) {
  141. background-color: #293146;
  142. .@{prefix-cls}-form {
  143. background-color: #fff;
  144. }
  145. }
  146. &::before {
  147. position: absolute;
  148. top: 0;
  149. left: 0;
  150. width: 100%;
  151. height: 100%;
  152. margin-left: -48%;
  153. background-image: url(/@/assets/svg/login-bg.svg);
  154. background-position: 100%;
  155. background-repeat: no-repeat;
  156. background-size: auto 100%;
  157. content: '';
  158. @media (max-width: @screen-xl) {
  159. display: none;
  160. }
  161. }
  162. .@{logo-prefix-cls} {
  163. position: absolute;
  164. top: 12px;
  165. height: 30px;
  166. &__title {
  167. font-size: 16px;
  168. color: #fff;
  169. }
  170. img {
  171. width: 32px;
  172. }
  173. }
  174. .container {
  175. .my-auto {
  176. .appcode {
  177. margin-top: 1.25rem;
  178. width: 340px;
  179. display: flex;
  180. justify-content: space-between;
  181. img {
  182. width: 150px;
  183. padding: 2px;
  184. background: #fff;
  185. }
  186. .title {
  187. text-align: center;
  188. margin-top: 10px;
  189. background: rgb(130, 166, 230);
  190. padding: 5px;
  191. border-radius: 3px;
  192. color: #fff;
  193. font-size: 20px;
  194. }
  195. }
  196. }
  197. .@{logo-prefix-cls} {
  198. display: flex;
  199. width: 60%;
  200. height: 80px;
  201. &__title {
  202. font-size: 24px;
  203. color: #fff;
  204. }
  205. img {
  206. width: 150px;
  207. }
  208. }
  209. }
  210. &-sign-in-way {
  211. .anticon {
  212. font-size: 22px;
  213. color: #888;
  214. cursor: pointer;
  215. &:hover {
  216. color: @primary-color;
  217. }
  218. }
  219. }
  220. input:not([type='checkbox']) {
  221. min-width: 360px;
  222. @media (max-width: @screen-xl) {
  223. min-width: 320px;
  224. }
  225. @media (max-width: @screen-lg) {
  226. min-width: 260px;
  227. }
  228. @media (max-width: @screen-md) {
  229. min-width: 240px;
  230. }
  231. @media (max-width: @screen-sm) {
  232. min-width: 160px;
  233. }
  234. }
  235. .@{countdown-prefix-cls} input {
  236. min-width: unset;
  237. }
  238. .ant-divider-inner-text {
  239. font-size: 12px;
  240. color: @text-color-secondary;
  241. }
  242. }
  243. </style>