index.vue 7.6 KB

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