Login.vue 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  1. <!--
  2. <template>
  3. <div
  4. :class="prefixCls"
  5. class="relative h-[100%] lt-md:px-10px lt-sm:px-10px lt-xl:px-10px lt-xl:px-10px"
  6. >
  7. <div class="relative mx-auto h-full flex">
  8. <div
  9. :class="`${prefixCls}__left flex-1 bg-gray-500 bg-opacity-20 relative p-30px lt-xl:hidden overflow-x-hidden overflow-y-auto`"
  10. >
  11. 左上角的 logo + 系统标题
  12. <div class="relative flex items-center text-white">
  13. <img alt="" class="mr-10px h-48px w-48px" src="@/assets/imgs/logo.png" />
  14. <span class="text-20px font-bold">{{ underlineToHump(appStore.getTitle) }}</span>
  15. </div>
  16. 左边的背景图 + 欢迎语
  17. <div class="h-[calc(100%-60px)] flex items-center justify-center">
  18. <TransitionGroup
  19. appear
  20. enter-active-class="animate__animated animate__bounceInLeft"
  21. tag="div"
  22. >
  23. <img key="1" alt="" class="w-350px" src="@/assets/svgs/login-box-bg.svg" />
  24. <div key="2" class="text-3xl text-white">{{ t('login.welcome') }}</div>
  25. <div key="3" class="mt-5 text-14px font-normal text-white">
  26. {{ t('login.message') }}
  27. </div>
  28. </TransitionGroup>
  29. </div>
  30. </div>
  31. <div
  32. class="relative flex-1 p-30px dark:bg-[var(--login-bg-color)] lt-sm:p-10px overflow-x-hidden overflow-y-auto"
  33. >
  34. 右上角的主题、语言选择
  35. <div
  36. class="flex items-center justify-between at-2xl:justify-end at-xl:justify-end"
  37. style="color: var(--el-text-color-primary);"
  38. >
  39. <div class="flex items-center at-2xl:hidden at-xl:hidden">
  40. <img alt="" class="mr-10px h-48px w-48px" src="@/assets/imgs/logo.png" />
  41. <span class="text-20px font-bold" >{{ underlineToHump(appStore.getTitle) }}</span>
  42. </div>
  43. <div class="flex items-center justify-end space-x-10px h-48px">
  44. <ThemeSwitch />
  45. <LocaleDropdown />
  46. </div>
  47. </div>
  48. 右边的登录界面
  49. <Transition appear enter-active-class="animate__animated animate__bounceInRight">
  50. <div
  51. class="m-auto h-[calc(100%-60px)] w-[100%] flex items-center at-2xl:max-w-500px at-lg:max-w-500px at-md:max-w-500px at-xl:max-w-500px"
  52. >
  53. 账号登录
  54. <LoginForm class="m-auto h-auto p-20px lt-xl:(rounded-3xl light:bg-white)" />
  55. 手机登录
  56. <MobileForm class="m-auto h-auto p-20px lt-xl:(rounded-3xl light:bg-white)" />
  57. 二维码登录
  58. <QrCodeForm class="m-auto h-auto p-20px lt-xl:(rounded-3xl light:bg-white)" />
  59. 注册
  60. <RegisterForm class="m-auto h-auto p-20px lt-xl:(rounded-3xl light:bg-white)" />
  61. 三方登录
  62. <SSOLoginVue class="m-auto h-auto p-20px lt-xl:(rounded-3xl light:bg-white)" />
  63. </div>
  64. </Transition>
  65. </div>
  66. </div>
  67. </div>
  68. </template>
  69. -->
  70. <!-- <script lang="ts" setup>
  71. import { underlineToHump } from '@/utils'
  72. import { useDesign } from '@/hooks/web/useDesign'
  73. import { useAppStore } from '@/store/modules/app'
  74. import { ThemeSwitch } from '@/layout/components/ThemeSwitch'
  75. import { LocaleDropdown } from '@/layout/components/LocaleDropdown'
  76. import { LoginForm, MobileForm, QrCodeForm, RegisterForm, SSOLoginVue } from './components'
  77. defineOptions({ name: 'Login' })
  78. const { t } = useI18n()
  79. const appStore = useAppStore()
  80. const { getPrefixCls } = useDesign()
  81. const prefixCls = getPrefixCls('login')
  82. </script> -->
  83. <!-- <style lang="scss" scoped>
  84. $prefix-cls: #{$namespace}-login;
  85. .#{$prefix-cls} {
  86. overflow: auto;
  87. &__left {
  88. &::before {
  89. position: absolute;
  90. top: 0;
  91. left: 0;
  92. z-index: -1;
  93. width: 100%;
  94. height: 100%;
  95. background-image: url('@/assets/svgs/login-bg.svg');
  96. background-position: center;
  97. background-repeat: no-repeat;
  98. content: '';
  99. }
  100. }
  101. }
  102. </style> -->
  103. <!-- <style lang="scss">
  104. .dark .login-form {
  105. .el-divider__text {
  106. background-color: var(--login-bg-color);
  107. }
  108. .el-card {
  109. background-color: var(--login-bg-color);
  110. }
  111. }
  112. </style> -->
  113. <template>
  114. <div
  115. :class="prefixCls"
  116. class="relative h-full flex flex-col items-center justify-center"
  117. style="background-image: url('http://172.16.59.50:9000/graduate/c252713a841785081220d558b8967220116fa4798d15b2600c402d9742963b2a.jpg'); background-size: cover;"
  118. >
  119. <!-- 上部的 logo + 系统标题 -->
  120. <div class="absolute top-5 left-5 flex items-center text-white">
  121. <img alt="" class="mr-2 h-48px w-48px" src="@/assets/imgs/logo.png" />
  122. <span class="text-20px font-bold">{{ underlineToHump(appStore.getTitle) }}</span>
  123. </div>
  124. <div class="m-auto h-auto max-w-3xl p-15 bg-#ffffff bg-opacity-50 backdrop-blur-md rounded-lg shadow-lg">
  125. <!-- 登录表单区域 -->
  126. <div class="flex justify-center ">
  127. <Transition appear enter-active-class="animate__animated animate__bounceIn">
  128. <div class="m-auto h-auto w-full max-w-2xl p-20px">
  129. <LoginForm class="m-auto h-auto" />
  130. <MobileForm class="m-auto h-auto" />
  131. <QrCodeForm class="m-auto h-auto" />
  132. <RegisterForm class="m-auto h-auto" />
  133. <!-- 三方登录 -->
  134. <SSOLoginVue class="m-auto h-auto" />
  135. </div>
  136. </Transition>
  137. </div>
  138. </div>
  139. <!-- 主题、语言选择区域 -->
  140. <div class="flex items-center justify-end w-full absolute top-5 right-5">
  141. <ThemeSwitch />
  142. <LocaleDropdown />
  143. </div>
  144. </div>
  145. </template>
  146. <script lang="ts" setup>
  147. import { underlineToHump } from '@/utils'
  148. import { useDesign } from '@/hooks/web/useDesign'
  149. import { useAppStore } from '@/store/modules/app'
  150. import { ThemeSwitch } from '@/layout/components/ThemeSwitch'
  151. import { LocaleDropdown } from '@/layout/components/LocaleDropdown'
  152. import { LoginForm, MobileForm, QrCodeForm, RegisterForm } from './components'
  153. defineOptions({ name: 'Login' })
  154. const { t } = useI18n()
  155. const appStore = useAppStore()
  156. const { getPrefixCls } = useDesign()
  157. const prefixCls = getPrefixCls('login')
  158. </script>
  159. <style lang="scss" scoped>
  160. $prefix-cls: #{$namespace}-login;
  161. .#{$prefix-cls} {
  162. display: flex;
  163. flex-direction: column;
  164. align-items: center;
  165. justify-content: center;
  166. height: 100vh; /* 使整体容器充满视口高度 */
  167. img {
  168. max-width: 100%;
  169. height: auto;
  170. }
  171. }
  172. </style>
  173. <style lang="scss">
  174. .dark .login-form {
  175. .el-divider__text {
  176. background-color: var(--login-bg-color);
  177. }
  178. .el-card {
  179. background-color: var(--login-bg-color);
  180. }
  181. }
  182. </style>