1
0

Login.vue 6.1 KB

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