Login.vue 7.2 KB

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