index.vue 8.2 KB

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