Login.vue 5.5 KB

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