Login.vue 4.3 KB
Newer Older
陈文彬 已提交
1
<template>
V
vben 已提交
2 3 4 5 6 7 8 9 10 11
  <div :class="prefixCls" class="relative w-full h-full px-4">
    <AppLocalePicker
      class="absolute top-4 right-4 enter-x text-white xl:text-gray-600"
      :showText="false"
    />

    <span class="-enter-x xl:hidden">
      <AppLogo :alwaysShowTitle="true" />
    </span>

V
vben 已提交
12
    <div class="container relative h-full py-2 mx-auto sm:px-10 -enter-x">
V
vben 已提交
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
      <div class="flex h-full">
        <div class="hidden xl:flex xl:flex-col xl:w-6/12 min-h-full mr-4 pl-4">
          <AppLogo class="-enter-x" />
          <div class="my-auto">
            <img
              :alt="title"
              src="../../../assets/svg/login-box-bg.svg"
              class="w-1/2 -mt-16 -enter-x"
            />
            <div class="mt-10 font-medium text-white -enter-x">
              <span class="mt-4 text-3xl inline-block"> {{ t('sys.login.signInTitle') }}</span>
            </div>
            <div class="mt-5 text-md text-white font-normal dark:text-gray-500 -enter-x">
              {{ t('sys.login.signInDesc') }}
            </div>
          </div>
        </div>
        <div class="h-full xl:h-auto flex py-5 xl:py-0 xl:my-0 w-full xl:w-6/12">
          <div
            class="my-auto mx-auto xl:ml-20 bg-white xl:bg-transparent px-5 py-8 sm:px-8 xl:p-0 rounded-md shadow-md xl:shadow-none w-full sm:w-3/4 lg:w-2/4 xl:w-auto enter-x relative"
          >
V
vben 已提交
34 35 36 37 38
            <LoginForm />
            <ForgetPasswordForm />
            <RegisterForm />
            <MobileForm />
            <QrCodeForm />
V
vben 已提交
39
          </div>
陈文彬 已提交
40 41 42 43 44 45
        </div>
      </div>
    </div>
  </div>
</template>
<script lang="ts">
V
vben 已提交
46
  import { defineComponent, computed } from 'vue';
47

V
vben 已提交
48
  import { AppLogo } from '/@/components/Application';
V
vben 已提交
49
  import { AppLocalePicker } from '/@/components/Application';
V
vben 已提交
50 51 52 53 54
  import LoginForm from './LoginForm.vue';
  import ForgetPasswordForm from './ForgetPasswordForm.vue';
  import RegisterForm from './RegisterForm.vue';
  import MobileForm from './MobileForm.vue';
  import QrCodeForm from './QrCodeForm.vue';
55

V
vben 已提交
56 57
  import { useGlobSetting, useProjectSetting } from '/@/hooks/setting';
  import { useI18n } from '/@/hooks/web/useI18n';
V
vben 已提交
58
  import { useDesign } from '/@/hooks/web/useDesign';
V
vben 已提交
59

陈文彬 已提交
60
  export default defineComponent({
V
vben 已提交
61
    name: 'Login',
62
    components: {
V
vben 已提交
63 64 65 66 67 68
      AppLogo,
      LoginForm,
      ForgetPasswordForm,
      RegisterForm,
      MobileForm,
      QrCodeForm,
V
vben 已提交
69
      AppLocalePicker,
70
    },
陈文彬 已提交
71
    setup() {
V
vben 已提交
72
      const globSetting = useGlobSetting();
V
vben 已提交
73
      const { prefixCls } = useDesign('login');
V
vben 已提交
74
      const { locale } = useProjectSetting();
V
vben 已提交
75
      const { t } = useI18n();
陈文彬 已提交
76 77

      return {
V
vben 已提交
78
        t,
V
vben 已提交
79 80 81
        prefixCls,
        title: computed(() => globSetting?.title ?? ''),
        showLocale: computed(() => locale.show),
陈文彬 已提交
82 83 84 85
      };
    },
  });
</script>
V
vben 已提交
86
<style lang="less">
V
vben 已提交
87 88 89
  @prefix-cls: ~'@{namespace}-login';
  @logo-prefix-cls: ~'@{namespace}-app-logo';
  @countdown-prefix-cls: ~'@{namespace}-countdown-input';
V
vben 已提交
90

V
vben 已提交
91 92 93 94
  .@{prefix-cls} {
    @media (max-width: @screen-xl) {
      background: linear-gradient(180deg, #1c3faa, #1c3faa);
    }
陈文彬 已提交
95

V
vben 已提交
96 97 98 99 100
    &::before {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
N
nebv 已提交
101
      height: 100%;
V
vben 已提交
102 103 104 105 106 107 108 109 110
      margin-left: -48%;
      background-image: url(/@/assets/svg/login-bg.svg);
      background-position: 100%;
      background-repeat: no-repeat;
      background-size: auto 100%;
      content: '';
      @media (max-width: @screen-xl) {
        display: none;
      }
陈文彬 已提交
111 112
    }

V
vben 已提交
113 114 115 116 117 118 119 120
    .@{logo-prefix-cls} {
      position: absolute;
      top: 12px;
      height: 30px;

      &__title {
        font-size: 16px;
        color: #fff;
V
vben 已提交
121 122
      }

V
vben 已提交
123 124
      img {
        width: 32px;
V
vben 已提交
125
      }
V
vben 已提交
126 127 128 129 130 131 132 133 134 135 136 137
    }

    .container {
      .@{logo-prefix-cls} {
        display: flex;
        width: 60%;
        height: 80px;

        &__title {
          font-size: 24px;
          color: #fff;
        }
V
vben 已提交
138

V
vben 已提交
139 140
        img {
          width: 48px;
N
nebv 已提交
141
        }
V
vben 已提交
142 143 144 145 146 147 148 149
      }
    }

    &-sign-in-way {
      .anticon {
        font-size: 22px;
        color: #888;
        cursor: pointer;
N
nebv 已提交
150

V
vben 已提交
151 152
        &:hover {
          color: @primary-color;
N
nebv 已提交
153 154
        }
      }
陈文彬 已提交
155
    }
V
vben 已提交
156 157 158 159 160 161 162 163 164 165 166 167 168 169 170

    input:not([type='checkbox']) {
      min-width: 360px;
      @media (max-width: @screen-sm) {
        min-width: 240px;
      }
    }
    .@{countdown-prefix-cls} input {
      min-width: unset;
    }

    .ant-divider-inner-text {
      font-size: 12px;
      color: @text-color-secondary;
    }
陈文彬 已提交
171 172
  }
</style>