Login.vue 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245
  1. <template>
  2. <div
  3. :class="prefixCls"
  4. class="relative h-[100%] lt-md:px-10px lt-sm:px-10px lt-xl:px-10px lt-xl:px-10px"
  5. >
  6. <div class="relative mx-auto h-full flex">
  7. <div
  8. :class="`${prefixCls}__left flex-1 bg-gray-500 bg-opacity-20 relative p-30px lt-xl:hidden overflow-x-hidden overflow-y-auto`"
  9. >
  10. <!-- 左上角的 logo + 系统标题 -->
  11. <div class="relative flex items-center text-white">
  12. <img alt="" class="mr-10px h-48px w-48px" src="@/assets/imgs/logo.png" />
  13. <span class="text-20px font-bold">{{ underlineToHump(appStore.getTitle) }}</span>
  14. </div>
  15. <!-- 左边的背景图 + 欢迎语 -->
  16. <div class="h-[calc(100%-60px)] flex items-center justify-center">
  17. <TransitionGroup
  18. appear
  19. enter-active-class="animate__animated animate__bounceInLeft"
  20. tag="div"
  21. >
  22. <!-- <img key="1" alt="" class="w-350px" src="@/assets/svgs/login-box-bg.svg" />-->
  23. <!-- <img key="1" alt="" class="w-350px" src="@/assets/imgs/yf.jpg" />-->
  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. <!-- 忘记密码 -->
  64. <ForgetPasswordForm class="m-auto h-auto p-20px lt-xl:(rounded-3xl light:bg-white)" />
  65. </div>
  66. </Transition>
  67. </div>
  68. </div>
  69. </div>
  70. </template>
  71. <script lang="ts" setup>
  72. import { underlineToHump } from '@/utils'
  73. import { useDesign } from '@/hooks/web/useDesign'
  74. import { useAppStore } from '@/store/modules/app'
  75. import { ThemeSwitch } from '@/layout/components/ThemeSwitch'
  76. import { LocaleDropdown } from '@/layout/components/LocaleDropdown'
  77. import { LoginForm, MobileForm, QrCodeForm, RegisterForm, SSOLoginVue, ForgetPasswordForm } from './components'
  78. defineOptions({ name: 'Login' })
  79. const { t } = useI18n()
  80. const appStore = useAppStore()
  81. const { getPrefixCls } = useDesign()
  82. const prefixCls = getPrefixCls('login')
  83. </script>
  84. <style lang="scss" scoped>
  85. $prefix-cls: #{$namespace}-login;
  86. .#{$prefix-cls} {
  87. overflow: auto;
  88. &__left {
  89. &::before {
  90. position: absolute;
  91. top: 0;
  92. left: 0;
  93. z-index: -1;
  94. width: 100%;
  95. height: 100%;
  96. background-image: url('@/assets/imgs/yf.png');
  97. background-position: center;
  98. background-repeat: no-repeat;
  99. content: '';
  100. background-size: cover; /* 关键:图片覆盖整个容器 */
  101. }
  102. }
  103. }
  104. </style>
  105. <style lang="scss">
  106. .dark .login-form {
  107. .el-divider__text {
  108. background-color: var(--login-bg-color);
  109. }
  110. .el-card {
  111. background-color: var(--login-bg-color);
  112. }
  113. }
  114. </style>
  115. <!--<template>-->
  116. <!-- <div-->
  117. <!-- :class="prefixCls"-->
  118. <!-- class="relative h-[100%] lt-md:px-10px lt-sm:px-10px lt-xl:px-10px lt-xl:px-10px"-->
  119. <!-- >-->
  120. <!-- <div class="relative mx-auto h-full flex">-->
  121. <!-- <div-->
  122. <!-- :class="`${prefixCls}__left flex-1 bg-gray-500 bg-opacity-20 relative p-30px lt-xl:hidden overflow-x-hidden overflow-y-auto`"-->
  123. <!-- >-->
  124. <!-- &lt;!&ndash; 左上角的 logo + 系统标题 &ndash;&gt;-->
  125. <!-- <div class="relative flex items-center text-white">-->
  126. <!-- <img alt="" class="mr-10px h-48px w-48px" src="@/assets/imgs/logo.png" />-->
  127. <!-- <span class="text-20px font-bold">{{ underlineToHump(appStore.getTitle) }}</span>-->
  128. <!-- </div>-->
  129. <!-- &lt;!&ndash; 左边的背景图 + 欢迎语 &ndash;&gt;-->
  130. <!-- <div class="h-[calc(100%-60px)] flex items-center justify-center">-->
  131. <!-- <TransitionGroup-->
  132. <!-- appear-->
  133. <!-- enter-active-class="animate__animated animate__bounceInLeft"-->
  134. <!-- tag="div"-->
  135. <!-- >-->
  136. <!-- <img key="1" alt="" class="w-350px" src="@/assets/svgs/login-box-bg.svg" />-->
  137. <!-- <div key="2" class="text-3xl text-white">{{ t('login.welcome') }}</div>-->
  138. <!-- <div key="3" class="mt-5 text-14px font-normal text-white">-->
  139. <!-- {{ t('login.message') }}-->
  140. <!-- </div>-->
  141. <!-- </TransitionGroup>-->
  142. <!-- </div>-->
  143. <!-- </div>-->
  144. <!-- <div-->
  145. <!-- class="relative flex-1 p-30px dark:bg-[var(&#45;&#45;login-bg-color)] lt-sm:p-10px overflow-x-hidden overflow-y-auto"-->
  146. <!-- >-->
  147. <!-- &lt;!&ndash; 右上角的主题、语言选择 &ndash;&gt;-->
  148. <!-- <div-->
  149. <!-- class="flex items-center justify-between at-2xl:justify-end at-xl:justify-end"-->
  150. <!-- style="color: var(&#45;&#45;el-text-color-primary);"-->
  151. <!-- >-->
  152. <!-- <div class="flex items-center at-2xl:hidden at-xl:hidden">-->
  153. <!-- <img alt="" class="mr-10px h-48px w-48px" src="@/assets/imgs/logo.png" />-->
  154. <!-- <span class="text-20px font-bold" >{{ underlineToHump(appStore.getTitle) }}</span>-->
  155. <!-- </div>-->
  156. <!-- <div class="flex items-center justify-end space-x-10px h-48px">-->
  157. <!-- <ThemeSwitch />-->
  158. <!-- <LocaleDropdown />-->
  159. <!-- </div>-->
  160. <!-- </div>-->
  161. <!-- &lt;!&ndash; 右边的登录界面 &ndash;&gt;-->
  162. <!-- <Transition appear enter-active-class="animate__animated animate__bounceInRight">-->
  163. <!-- <div-->
  164. <!-- 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"-->
  165. <!-- >-->
  166. <!-- &lt;!&ndash; 账号登录 &ndash;&gt;-->
  167. <!-- <LoginForm class="m-auto h-auto p-20px lt-xl:(rounded-3xl light:bg-white)" />-->
  168. <!-- &lt;!&ndash; 手机登录 &ndash;&gt;-->
  169. <!-- <MobileForm class="m-auto h-auto p-20px lt-xl:(rounded-3xl light:bg-white)" />-->
  170. <!-- &lt;!&ndash; 二维码登录 &ndash;&gt;-->
  171. <!-- <QrCodeForm class="m-auto h-auto p-20px lt-xl:(rounded-3xl light:bg-white)" />-->
  172. <!-- &lt;!&ndash; 注册 &ndash;&gt;-->
  173. <!-- <RegisterForm class="m-auto h-auto p-20px lt-xl:(rounded-3xl light:bg-white)" />-->
  174. <!-- &lt;!&ndash; 三方登录 &ndash;&gt;-->
  175. <!-- <SSOLoginVue class="m-auto h-auto p-20px lt-xl:(rounded-3xl light:bg-white)" />-->
  176. <!-- &lt;!&ndash; 忘记密码 &ndash;&gt;-->
  177. <!-- <ForgetPasswordForm class="m-auto h-auto p-20px lt-xl:(rounded-3xl light:bg-white)" />-->
  178. <!-- </div>-->
  179. <!-- </Transition>-->
  180. <!-- </div>-->
  181. <!-- </div>-->
  182. <!-- </div>-->
  183. <!--</template>-->
  184. <!--<script lang="ts" setup>-->
  185. <!--import { underlineToHump } from '@/utils'-->
  186. <!--import { useDesign } from '@/hooks/web/useDesign'-->
  187. <!--import { useAppStore } from '@/store/modules/app'-->
  188. <!--import { ThemeSwitch } from '@/layout/components/ThemeSwitch'-->
  189. <!--import { LocaleDropdown } from '@/layout/components/LocaleDropdown'-->
  190. <!--import { LoginForm, MobileForm, QrCodeForm, RegisterForm, SSOLoginVue, ForgetPasswordForm } from './components'-->
  191. <!--defineOptions({ name: 'Login' })-->
  192. <!--const { t } = useI18n()-->
  193. <!--const appStore = useAppStore()-->
  194. <!--const { getPrefixCls } = useDesign()-->
  195. <!--const prefixCls = getPrefixCls('login')-->
  196. <!--</script>-->
  197. <!--<style lang="scss" scoped>-->
  198. <!--$prefix-cls: #{$namespace}-login;-->
  199. <!--.#{$prefix-cls} {-->
  200. <!-- overflow: auto;-->
  201. <!-- &__left {-->
  202. <!-- &::before {-->
  203. <!-- position: absolute;-->
  204. <!-- top: 0;-->
  205. <!-- left: 0;-->
  206. <!-- z-index: -1;-->
  207. <!-- width: 100%;-->
  208. <!-- height: 100%;-->
  209. <!-- background-image: url('@/assets/svgs/login-bg.svg');-->
  210. <!-- background-position: center;-->
  211. <!-- background-repeat: no-repeat;-->
  212. <!-- content: '';-->
  213. <!-- }-->
  214. <!-- }-->
  215. <!--}-->
  216. <!--</style>-->
  217. <!--<style lang="scss">-->
  218. <!--.dark .login-form {-->
  219. <!-- .el-divider__text {-->
  220. <!-- background-color: var(&#45;&#45;login-bg-color);-->
  221. <!-- }-->
  222. <!-- .el-card {-->
  223. <!-- background-color: var(&#45;&#45;login-bg-color);-->
  224. <!-- }-->
  225. <!--}-->
  226. <!--</style>-->