index.vue 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313
  1. <template>
  2. <div class="login-container flex">
  3. <div class="login-left">
  4. <div class="login-left-logo">
  5. <!-- <img src="src/assets/ansjer_image.png"/> -->
  6. <el-image style="width: 110px; height: 110px" :src="AnsjerImg" fit="contain" />
  7. <!-- 登录页左上角logo后面的文字 -->
  8. <!-- <div class="login-left-logo-text">
  9. <span>{{ getThemeConfig.globalViceTitle }}</span>
  10. <span class="login-left-logo-text-msg">{{ getThemeConfig.globalViceTitleMsg }}</span>
  11. </div> -->
  12. </div>
  13. <div class="login-left-img">
  14. <img :src="loginMain" />
  15. </div>
  16. <img :src="loginBg" class="login-left-waves" />
  17. </div>
  18. <div class="login-right flex">
  19. <div class="login-right-warp flex-margin">
  20. <span class="login-right-warp-one"></span>
  21. <span class="login-right-warp-two"></span>
  22. <div class="login-right-warp-mian">
  23. <div class="login-right-warp-main-title">{{ getThemeConfig.globalTitle }} 欢迎您!</div>
  24. <div class="login-right-warp-main-form">
  25. <div v-if="!state.isScan">
  26. <el-tabs v-model="state.tabsActiveName">
  27. <el-tab-pane :label="$t('message.label.one1')" name="account">
  28. <Account />
  29. </el-tab-pane>
  30. <!-- TODO 手机号码登录未接入,展示隐藏 -->
  31. <!-- <el-tab-pane :label="$t('message.label.two2')" name="mobile">
  32. <Mobile />
  33. </el-tab-pane> -->
  34. </el-tabs>
  35. </div>
  36. <Scan v-if="state.isScan" />
  37. <div class="login-content-main-sacn" @click="state.isScan = !state.isScan">
  38. <i class="iconfont" :class="state.isScan ? 'icon-diannao1' : 'icon-barcode-qr'"></i>
  39. <div class="login-content-main-sacn-delta"></div>
  40. </div>
  41. </div>
  42. </div>
  43. </div>
  44. </div>
  45. <div class="login-authorization">
  46. <p>Copyright © 2023-2024 Ansjer 版权所有</p>
  47. <!-- <p class="la-other">
  48. <a href="https://beian.miit.gov.cn" target="_blank">晋ICP备18005113号-3</a>
  49. |
  50. <a href="https://django-vue-admin.com" target="_blank">帮助</a>
  51. |
  52. <a href="#">隐私</a>
  53. |
  54. <a href="#">条款</a>
  55. </p> -->
  56. </div>
  57. </div>
  58. </template>
  59. <script setup lang="ts" name="loginIndex">
  60. import { defineAsyncComponent, onMounted, reactive, computed } from 'vue';
  61. import { storeToRefs } from 'pinia';
  62. import { useThemeConfig } from '/@/stores/themeConfig';
  63. import { NextLoading } from '/@/utils/loading';
  64. import logoMini from '/@/assets/logo-mini.svg';
  65. import loginMain from '/@/assets/login-main.svg';
  66. import loginBg from '/@/assets/login-bg.svg';
  67. import AnsjerImg from '/@/assets/ansjer_image.png';
  68. // 引入组件
  69. const Account = defineAsyncComponent(() => import('/@/views/system/login/component/account.vue'));
  70. const Mobile = defineAsyncComponent(() => import('/@/views/system/login/component/mobile.vue'));
  71. const Scan = defineAsyncComponent(() => import('/@/views/system/login/component/scan.vue'));
  72. // 定义变量内容
  73. const storesThemeConfig = useThemeConfig();
  74. const { themeConfig } = storeToRefs(storesThemeConfig);
  75. const state = reactive({
  76. tabsActiveName: 'account',
  77. isScan: false,
  78. });
  79. // 获取布局配置信息
  80. const getThemeConfig = computed(() => {
  81. return themeConfig.value;
  82. });
  83. // 页面加载时
  84. onMounted(() => {
  85. NextLoading.done();
  86. });
  87. </script>
  88. <style scoped lang="scss">
  89. .login-container {
  90. height: 100%;
  91. background: var(--el-color-white);
  92. .login-left {
  93. flex: 1;
  94. position: relative;
  95. background-color: rgba(211, 239, 255, 1);
  96. margin-right: 100px;
  97. .login-left-logo {
  98. display: flex;
  99. align-items: center;
  100. position: absolute;
  101. top: 50px;
  102. left: 80px;
  103. z-index: 1;
  104. animation: logoAnimation 0.3s ease;
  105. img {
  106. width: 52px;
  107. height: 52px;
  108. }
  109. .login-left-logo-text {
  110. display: flex;
  111. flex-direction: column;
  112. span {
  113. margin-left: 10px;
  114. font-size: 16px;
  115. color: var(--el-color-primary);
  116. }
  117. .login-left-logo-text-msg {
  118. font-size: 12px;
  119. color: var(--el-color-primary);
  120. }
  121. }
  122. }
  123. .login-left-img {
  124. position: absolute;
  125. top: 50%;
  126. left: 50%;
  127. transform: translate(-50%, -50%);
  128. width: 100%;
  129. height: 52%;
  130. img {
  131. width: 100%;
  132. height: 100%;
  133. animation: error-num 0.6s ease;
  134. }
  135. }
  136. .login-left-waves {
  137. position: absolute;
  138. top: 0;
  139. right: -100px;
  140. }
  141. }
  142. .login-right {
  143. width: 700px;
  144. .login-right-warp {
  145. border: 1px solid var(--el-color-primary-light-3);
  146. border-radius: 3px;
  147. width: 500px;
  148. height: 500px;
  149. position: relative;
  150. overflow: hidden;
  151. background-color: var(--el-color-white);
  152. .login-right-warp-one,
  153. .login-right-warp-two {
  154. position: absolute;
  155. display: block;
  156. width: inherit;
  157. height: inherit;
  158. &::before,
  159. &::after {
  160. content: '';
  161. position: absolute;
  162. z-index: 1;
  163. }
  164. }
  165. .login-right-warp-one {
  166. &::before {
  167. filter: hue-rotate(0deg);
  168. top: 0px;
  169. left: 0;
  170. width: 100%;
  171. height: 3px;
  172. background: linear-gradient(90deg, transparent, var(--el-color-primary));
  173. animation: loginLeft 3s linear infinite;
  174. }
  175. &::after {
  176. filter: hue-rotate(60deg);
  177. top: -100%;
  178. right: 2px;
  179. width: 3px;
  180. height: 100%;
  181. background: linear-gradient(180deg, transparent, var(--el-color-primary));
  182. animation: loginTop 3s linear infinite;
  183. animation-delay: 0.7s;
  184. }
  185. }
  186. .login-right-warp-two {
  187. &::before {
  188. filter: hue-rotate(120deg);
  189. bottom: 2px;
  190. right: -100%;
  191. width: 100%;
  192. height: 3px;
  193. background: linear-gradient(270deg, transparent, var(--el-color-primary));
  194. animation: loginRight 3s linear infinite;
  195. animation-delay: 1.4s;
  196. }
  197. &::after {
  198. filter: hue-rotate(300deg);
  199. bottom: -100%;
  200. left: 0px;
  201. width: 3px;
  202. height: 100%;
  203. background: linear-gradient(360deg, transparent, var(--el-color-primary));
  204. animation: loginBottom 3s linear infinite;
  205. animation-delay: 2.1s;
  206. }
  207. }
  208. .login-right-warp-mian {
  209. display: flex;
  210. flex-direction: column;
  211. height: 100%;
  212. .login-right-warp-main-title {
  213. height: 130px;
  214. line-height: 130px;
  215. font-size: 27px;
  216. text-align: center;
  217. letter-spacing: 3px;
  218. animation: logoAnimation 0.3s ease;
  219. animation-delay: 0.3s;
  220. color: var(--el-text-color-primary);
  221. }
  222. .login-right-warp-main-form {
  223. flex: 1;
  224. padding: 0 50px 50px;
  225. .login-content-main-sacn {
  226. position: absolute;
  227. top: 0;
  228. right: 0;
  229. width: 50px;
  230. height: 50px;
  231. overflow: hidden;
  232. cursor: pointer;
  233. transition: all ease 0.3s;
  234. color: var(--el-color-primary);
  235. &-delta {
  236. position: absolute;
  237. width: 35px;
  238. height: 70px;
  239. z-index: 2;
  240. top: 2px;
  241. right: 21px;
  242. background: var(--el-color-white);
  243. transform: rotate(-45deg);
  244. }
  245. &:hover {
  246. opacity: 1;
  247. transition: all ease 0.3s;
  248. color: var(--el-color-primary) !important;
  249. }
  250. i {
  251. width: 47px;
  252. height: 50px;
  253. display: inline-block;
  254. font-size: 48px;
  255. position: absolute;
  256. right: 1px;
  257. top: 0px;
  258. }
  259. }
  260. }
  261. }
  262. }
  263. }
  264. .login-authorization {
  265. position: fixed;
  266. bottom: 30px;
  267. left: 0;
  268. right: 0;
  269. text-align: center;
  270. p {
  271. font-size: 14px;
  272. color: rgba(0, 0, 0, 0.5);
  273. }
  274. a {
  275. color: var(--el-color-primary);
  276. margin: 0 5px;
  277. }
  278. }
  279. }
  280. </style>