Login.vue 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267
  1. <!-- eslint-disable vue/multi-word-component-names -->
  2. <template>
  3. <!-- <AdaptiveContainer :options="{ width: 1920, height: 1080 }" style="overflow-y: hidden"> -->
  4. <div class="login-container" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%">
  5. <div class="login-bg"></div>
  6. <span class="-enter-x xl:hidden">
  7. <AppLogo :alwaysShowTitle="true" />
  8. </span>
  9. <div class="top-header">
  10. <div class="top-bg"></div>
  11. <div class="login-icon"></div>
  12. <div class="title">{{ title }}</div>
  13. </div>
  14. <div class="flex center">
  15. <LoginForm />
  16. </div>
  17. <div class="bottom"> </div>
  18. </div>
  19. <!-- </AdaptiveContainer> -->
  20. </template>
  21. <script lang="ts" setup>
  22. import { computed } from 'vue';
  23. import { AppLogo } from '/@/components/Application';
  24. import LoginForm from './LoginForm.vue';
  25. import { useGlobSetting } from '/@/hooks/setting';
  26. // import { useI18n } from '/@/hooks/web/useI18n';
  27. // import { useDesign } from '/@/hooks/web/useDesign';
  28. // import { useLocaleStore } from '/@/store/modules/locale';
  29. import { useLoginState } from './useLogin';
  30. // import AdaptiveContainer from '/@/components/Container/src/Adaptive.vue';
  31. defineProps({
  32. sessionTimeout: {
  33. type: Boolean,
  34. },
  35. });
  36. const globSetting = useGlobSetting();
  37. // const { prefixCls } = useDesign('login');
  38. // const { t } = useI18n();
  39. // const localeStore = useLocaleStore();
  40. // const showLocale = localeStore.getShowPicker;
  41. const title = computed(() => globSetting?.title ?? '');
  42. const { handleBackLogin } = useLoginState();
  43. handleBackLogin();
  44. </script>
  45. <style lang="less" scoped>
  46. @prefix-cls: ~'@{namespace}-login';
  47. @logo-prefix-cls: ~'@{namespace}-app-logo';
  48. @countdown-prefix-cls: ~'@{namespace}-countdown-input';
  49. @dark-bg: #293146;
  50. @ventSpace: zxm;
  51. html[data-theme='dark'] {
  52. .@{prefix-cls} {
  53. background-color: @dark-bg;
  54. &::before {
  55. background-image: url(/@/assets/svg/login-bg-dark.svg);
  56. }
  57. .@{ventSpace}-input,
  58. .@{ventSpace}-input-password {
  59. background-color: #232a3b;
  60. }
  61. .@{ventSpace}-btn:not(.@{ventSpace}-btn-link):not(.@{ventSpace}-btn-primary) {
  62. border: 1px solid #4a5569;
  63. }
  64. &-form {
  65. background: transparent !important;
  66. }
  67. .app-iconify {
  68. color: #fff;
  69. }
  70. }
  71. input.fix-auto-fill,
  72. .fix-auto-fill input {
  73. -webkit-text-fill-color: #c9d1d9 !important;
  74. box-shadow: inherit !important;
  75. }
  76. }
  77. .login-container {
  78. width: 100vw;
  79. height: 100%;
  80. background: linear-gradient(to bottom, #000c37, #001e63);
  81. padding: 0 !important;
  82. position: relative;
  83. &::before {
  84. content: '';
  85. position: absolute;
  86. width: 100%;
  87. height: 100%;
  88. top: 0px;
  89. left: 0;
  90. background-image: url('/@/assets/images/vent/login/bg.png');
  91. background-size: cover;
  92. }
  93. .login-bg {
  94. position: absolute;
  95. width: 100%;
  96. height: 100%;
  97. top: 0;
  98. left: 0;
  99. background: linear-gradient(to bottom, #000c3766, #001e6366);
  100. }
  101. .top-header {
  102. width: 100%;
  103. display: flex;
  104. flex-direction: column;
  105. justify-content: center;
  106. align-items: center;
  107. position: relative;
  108. // padding-top: 70px;
  109. .top-bg {
  110. width: 100%;
  111. height: 129px;
  112. background-image: url('/@/assets/images/vent/login/top.png');
  113. background-size: 100% auto;
  114. }
  115. .login-icon {
  116. position: relative;
  117. width: 237px;
  118. height: 274px;
  119. top: 10px;
  120. background-image: url('/@/assets/images/vent/login/icon.png');
  121. }
  122. .title {
  123. position: absolute;
  124. top: 78px;
  125. color: rgb(224, 224, 224);
  126. font-size: 30px;
  127. text-align: center;
  128. text-shadow:
  129. 1px 1px 1px #fff,
  130. -1px -1px 1px #000;
  131. }
  132. }
  133. .bottom {
  134. width: 100%;
  135. height: 118px;
  136. position: fixed;
  137. bottom: 0;
  138. left: 0;
  139. background-image: url('/@/assets/images/vent/login/down.png');
  140. background-size: 100% auto;
  141. }
  142. .center {
  143. width: 100%;
  144. height: calc(100% - 540px);
  145. display: flex;
  146. flex-direction: column;
  147. align-items: center;
  148. position: relative;
  149. justify-content: center;
  150. }
  151. }
  152. .@{prefix-cls} {
  153. min-height: 100%;
  154. overflow: hidden;
  155. @media (max-width: @screen-xl) {
  156. background-color: #293146;
  157. .@{prefix-cls}-form {
  158. background-color: #fff;
  159. }
  160. }
  161. &::before {
  162. position: absolute;
  163. top: 0;
  164. left: 0;
  165. width: 100%;
  166. height: 100%;
  167. margin-left: -48%;
  168. // background-image: url(/@/assets/svg/login-bg.svg);
  169. background-position: 100%;
  170. background-repeat: no-repeat;
  171. background-size: auto 100%;
  172. content: '';
  173. @media (max-width: @screen-xl) {
  174. display: none;
  175. }
  176. }
  177. .@{logo-prefix-cls} {
  178. position: absolute;
  179. top: 12px;
  180. height: 30px;
  181. &__title {
  182. font-size: 16px;
  183. color: #fff;
  184. }
  185. img {
  186. width: 32px;
  187. }
  188. }
  189. .container {
  190. .@{logo-prefix-cls} {
  191. display: flex;
  192. width: 60%;
  193. height: 80px;
  194. &__title {
  195. font-size: 24px;
  196. color: #fff;
  197. }
  198. img {
  199. width: 48px;
  200. }
  201. }
  202. }
  203. &-sign-in-way {
  204. .anticon {
  205. font-size: 22px;
  206. color: #888;
  207. cursor: pointer;
  208. &:hover {
  209. color: @primary-color;
  210. }
  211. }
  212. }
  213. input:not([type='checkbox']) {
  214. min-width: 360px;
  215. @media (max-width: @screen-xl) {
  216. min-width: 320px;
  217. }
  218. @media (max-width: @screen-lg) {
  219. min-width: 260px;
  220. }
  221. @media (max-width: @screen-md) {
  222. min-width: 240px;
  223. }
  224. @media (max-width: @screen-sm) {
  225. min-width: 160px;
  226. }
  227. }
  228. .@{countdown-prefix-cls} input {
  229. min-width: unset;
  230. }
  231. .@{ventSpace}-divider-inner-text {
  232. font-size: 12px;
  233. color: @text-color-secondary;
  234. }
  235. }
  236. </style>