Login.vue 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289
  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. @import '/@/design/theme.less';
  47. @prefix-cls: ~'@{namespace}-login';
  48. @logo-prefix-cls: ~'@{namespace}-app-logo';
  49. @countdown-prefix-cls: ~'@{namespace}-countdown-input';
  50. @dark-bg: #293146;
  51. @ventSpace: zxm;
  52. html[data-theme='dark'] {
  53. .@{prefix-cls} {
  54. background-color: @dark-bg;
  55. &::before {
  56. background-image: url(/@/assets/svg/login-bg-dark.svg);
  57. }
  58. .@{ventSpace}-input,
  59. .@{ventSpace}-input-password {
  60. background-color: #232a3b;
  61. }
  62. .@{ventSpace}-btn:not(.@{ventSpace}-btn-link):not(.@{ventSpace}-btn-primary) {
  63. border: 1px solid #4a5569;
  64. }
  65. &-form {
  66. background: transparent !important;
  67. }
  68. .app-iconify {
  69. color: #fff;
  70. }
  71. }
  72. input.fix-auto-fill,
  73. .fix-auto-fill input {
  74. -webkit-text-fill-color: #c9d1d9 !important;
  75. box-shadow: inherit !important;
  76. }
  77. }
  78. // 深蓝色主题特化的变量
  79. @{theme-deepblue} {
  80. .login-container {
  81. --image-top: url('/@/assets/images/themify/deepblue/login/top.png');
  82. --image-icon: url('/@/assets/images/themify/deepblue/login/icon.png');
  83. --image-down: url('/@/assets/images/themify/deepblue/login/down.png');
  84. --image-bg: none;
  85. --container-bg: #021632;
  86. }
  87. }
  88. .login-container {
  89. // 需要主题化的变量放在上面
  90. --image-top: url('/@/assets/images/vent/login/top.png');
  91. --image-icon: url('/@/assets/images/vent/login/icon.png');
  92. --image-down: url('/@/assets/images/vent/login/down.png');
  93. --image-bg: url('/@/assets/images/vent/login/bg.png');
  94. --container-bg: linear-gradient(to bottom, #000c37, #001e63);
  95. // 下面是不需要主题化的变量,例如单色图标、中性颜色等
  96. --login-bg: linear-gradient(to bottom, #000c3766, #001e6366);
  97. color: @vent-text-base;
  98. width: 100vw;
  99. height: 100%;
  100. background: var(--container-bg);
  101. padding: 0 !important;
  102. position: relative;
  103. &::before {
  104. content: '';
  105. position: absolute;
  106. width: 100%;
  107. height: 100%;
  108. top: 0px;
  109. left: 0;
  110. background-image: var(--image-bg);
  111. background-size: cover;
  112. }
  113. .login-bg {
  114. position: absolute;
  115. width: 100%;
  116. height: 100%;
  117. top: 0;
  118. left: 0;
  119. background: var(--login-bg);
  120. }
  121. .top-header {
  122. width: 100%;
  123. display: flex;
  124. flex-direction: column;
  125. justify-content: center;
  126. align-items: center;
  127. position: relative;
  128. // padding-top: 70px;
  129. .top-bg {
  130. width: 100%;
  131. height: 129px;
  132. background-image: var(--image-top);
  133. background-size: 100% auto;
  134. }
  135. .login-icon {
  136. position: relative;
  137. width: 237px;
  138. height: 274px;
  139. top: 10px;
  140. background-image: var(--image-icon);
  141. }
  142. .title {
  143. position: absolute;
  144. top: 78px;
  145. color: rgb(224, 224, 224);
  146. font-size: 30px;
  147. text-align: center;
  148. text-shadow:
  149. 1px 1px 1px #fff,
  150. -1px -1px 1px #000;
  151. }
  152. }
  153. .bottom {
  154. width: 100%;
  155. height: 118px;
  156. position: fixed;
  157. bottom: 0;
  158. left: 0;
  159. background-image: var(--image-down);
  160. background-size: 100% auto;
  161. }
  162. .center {
  163. width: 100%;
  164. height: calc(100% - 540px);
  165. display: flex;
  166. flex-direction: column;
  167. align-items: center;
  168. position: relative;
  169. justify-content: center;
  170. }
  171. }
  172. .@{prefix-cls} {
  173. min-height: 100%;
  174. overflow: hidden;
  175. @media (max-width: @screen-xl) {
  176. background-color: #293146;
  177. .@{prefix-cls}-form {
  178. background-color: #fff;
  179. }
  180. }
  181. &::before {
  182. position: absolute;
  183. top: 0;
  184. left: 0;
  185. width: 100%;
  186. height: 100%;
  187. margin-left: -48%;
  188. // background-image: url(/@/assets/svg/login-bg.svg);
  189. background-position: 100%;
  190. background-repeat: no-repeat;
  191. background-size: auto 100%;
  192. content: '';
  193. @media (max-width: @screen-xl) {
  194. display: none;
  195. }
  196. }
  197. .@{logo-prefix-cls} {
  198. position: absolute;
  199. top: 12px;
  200. height: 30px;
  201. &__title {
  202. font-size: 16px;
  203. color: #fff;
  204. }
  205. img {
  206. width: 32px;
  207. }
  208. }
  209. .container {
  210. .@{logo-prefix-cls} {
  211. display: flex;
  212. width: 60%;
  213. height: 80px;
  214. &__title {
  215. font-size: 24px;
  216. color: #fff;
  217. }
  218. img {
  219. width: 48px;
  220. }
  221. }
  222. }
  223. &-sign-in-way {
  224. .anticon {
  225. font-size: 22px;
  226. color: #888;
  227. cursor: pointer;
  228. &:hover {
  229. color: @primary-color;
  230. }
  231. }
  232. }
  233. input:not([type='checkbox']) {
  234. min-width: 360px;
  235. @media (max-width: @screen-xl) {
  236. min-width: 320px;
  237. }
  238. @media (max-width: @screen-lg) {
  239. min-width: 260px;
  240. }
  241. @media (max-width: @screen-md) {
  242. min-width: 240px;
  243. }
  244. @media (max-width: @screen-sm) {
  245. min-width: 160px;
  246. }
  247. }
  248. .@{countdown-prefix-cls} input {
  249. min-width: unset;
  250. }
  251. .@{ventSpace}-divider-inner-text {
  252. font-size: 12px;
  253. color: @text-color-secondary;
  254. }
  255. }
  256. </style>