index.vue 8.0 KB

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