|
@@ -24,7 +24,11 @@
|
|
|
</Header>
|
|
</Header>
|
|
|
<div class="go-login">
|
|
<div class="go-login">
|
|
|
<div class="go-login-carousel">
|
|
<div class="go-login-carousel">
|
|
|
- <n-carousel autoplay dot-type="line" :interval="Number(carouselInterval)">
|
|
|
|
|
|
|
+ <n-carousel
|
|
|
|
|
+ autoplay
|
|
|
|
|
+ dot-type="line"
|
|
|
|
|
+ :interval="Number(carouselInterval)"
|
|
|
|
|
+ >
|
|
|
<img
|
|
<img
|
|
|
v-for="(item, i) in carouselImgList"
|
|
v-for="(item, i) in carouselImgList"
|
|
|
:key="i"
|
|
:key="i"
|
|
@@ -39,7 +43,11 @@
|
|
|
<n-collapse-transition :appear="true" :show="show">
|
|
<n-collapse-transition :appear="true" :show="show">
|
|
|
<n-card class="login-account-card" :title="$t('login.desc')">
|
|
<n-card class="login-account-card" :title="$t('login.desc')">
|
|
|
<div class="login-account-top">
|
|
<div class="login-account-top">
|
|
|
- <img class="login-account-top-logo" src="~@/assets/images/login/input.png" alt="展示图片" />
|
|
|
|
|
|
|
+ <img
|
|
|
|
|
+ class="login-account-top-logo"
|
|
|
|
|
+ src="~@/assets/images/login/input.png"
|
|
|
|
|
+ alt="展示图片"
|
|
|
|
|
+ />
|
|
|
</div>
|
|
</div>
|
|
|
<n-form
|
|
<n-form
|
|
|
ref="formRef"
|
|
ref="formRef"
|
|
@@ -77,7 +85,9 @@
|
|
|
<n-form-item>
|
|
<n-form-item>
|
|
|
<div class="flex justify-between">
|
|
<div class="flex justify-between">
|
|
|
<div class="flex-initial">
|
|
<div class="flex-initial">
|
|
|
- <n-checkbox v-model:checked="autoLogin">{{ $t('login.form_auto') }}</n-checkbox>
|
|
|
|
|
|
|
+ <n-checkbox v-model:checked="autoLogin">{{
|
|
|
|
|
+ $t('login.form_auto')
|
|
|
|
|
+ }}</n-checkbox>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</n-form-item>
|
|
</n-form-item>
|
|
@@ -88,7 +98,8 @@
|
|
|
size="large"
|
|
size="large"
|
|
|
:loading="loading"
|
|
:loading="loading"
|
|
|
block
|
|
block
|
|
|
- >{{ $t('login.form_button') }}</n-button>
|
|
|
|
|
|
|
+ >{{ $t('login.form_button') }}</n-button
|
|
|
|
|
+ >
|
|
|
</n-form-item>
|
|
</n-form-item>
|
|
|
</n-form>
|
|
</n-form>
|
|
|
</n-card>
|
|
</n-card>
|
|
@@ -105,8 +116,12 @@
|
|
|
|
|
|
|
|
<script lang="ts" setup>
|
|
<script lang="ts" setup>
|
|
|
import { reactive, ref, onMounted } from 'vue'
|
|
import { reactive, ref, onMounted } from 'vue'
|
|
|
-import { requireUrl } from '@/utils'
|
|
|
|
|
-import { routerTurnByName } from '@/utils'
|
|
|
|
|
|
|
+import {
|
|
|
|
|
+ routerTurnByName,
|
|
|
|
|
+ requireUrl,
|
|
|
|
|
+ cryptoEncode,
|
|
|
|
|
+ setLocalStorage
|
|
|
|
|
+} from '@/utils'
|
|
|
import shuffle from 'lodash/shuffle'
|
|
import shuffle from 'lodash/shuffle'
|
|
|
import { carouselInterval } from '@/settings/designSetting'
|
|
import { carouselInterval } from '@/settings/designSetting'
|
|
|
import { useDesignStore } from '@/store/modules/designStore/designStore'
|
|
import { useDesignStore } from '@/store/modules/designStore/designStore'
|
|
@@ -116,6 +131,9 @@ import { Header } from '@/layout/components/Header'
|
|
|
import { Footer } from '@/layout/components/Footer'
|
|
import { Footer } from '@/layout/components/Footer'
|
|
|
import { PageEnum } from '@/enums/pageEnum'
|
|
import { PageEnum } from '@/enums/pageEnum'
|
|
|
import { icon } from '@/plugins'
|
|
import { icon } from '@/plugins'
|
|
|
|
|
+import { StorageEnum } from '@/enums/storageEnum'
|
|
|
|
|
+
|
|
|
|
|
+const { GO_LOGIN_INFO_STORE } = StorageEnum
|
|
|
|
|
|
|
|
const { PersonOutlineIcon, LockClosedOutlineIcon } = icon.ionicons5
|
|
const { PersonOutlineIcon, LockClosedOutlineIcon } = icon.ionicons5
|
|
|
|
|
|
|
@@ -198,6 +216,15 @@ const handleSubmit = (e: Event) => {
|
|
|
if (!errors) {
|
|
if (!errors) {
|
|
|
const { username, password } = formInline
|
|
const { username, password } = formInline
|
|
|
loading.value = true
|
|
loading.value = true
|
|
|
|
|
+ setLocalStorage(
|
|
|
|
|
+ GO_LOGIN_INFO_STORE,
|
|
|
|
|
+ cryptoEncode(
|
|
|
|
|
+ JSON.stringify({
|
|
|
|
|
+ username,
|
|
|
|
|
+ password
|
|
|
|
|
+ })
|
|
|
|
|
+ )
|
|
|
|
|
+ )
|
|
|
window['$message'].success(`${t('login.login_success')}!`)
|
|
window['$message'].success(`${t('login.login_success')}!`)
|
|
|
routerTurnByName(PageEnum.BASE_HOME_NAME, true)
|
|
routerTurnByName(PageEnum.BASE_HOME_NAME, true)
|
|
|
} else {
|
|
} else {
|
|
@@ -225,7 +252,7 @@ $carousel-image-height: 60vh;
|
|
|
@include go(login-box) {
|
|
@include go(login-box) {
|
|
|
height: $go-login-height;
|
|
height: $go-login-height;
|
|
|
overflow: hidden;
|
|
overflow: hidden;
|
|
|
- @include background-image("background-image");
|
|
|
|
|
|
|
+ @include background-image('background-image');
|
|
|
&-header {
|
|
&-header {
|
|
|
display: flex;
|
|
display: flex;
|
|
|
justify-content: space-between;
|
|
justify-content: space-between;
|
|
@@ -266,7 +293,7 @@ $carousel-image-height: 60vh;
|
|
|
|
|
|
|
|
&-card {
|
|
&-card {
|
|
|
@extend .go-background-filter;
|
|
@extend .go-background-filter;
|
|
|
- @include filter-bg-color("filter-color");
|
|
|
|
|
|
|
+ @include filter-bg-color('filter-color');
|
|
|
box-shadow: 0 0 20px 5px rgba(40, 40, 40, 0.5);
|
|
box-shadow: 0 0 20px 5px rgba(40, 40, 40, 0.5);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -294,7 +321,7 @@ $carousel-image-height: 60vh;
|
|
|
align-items: center;
|
|
align-items: center;
|
|
|
width: $--max-width;
|
|
width: $--max-width;
|
|
|
height: 100vh;
|
|
height: 100vh;
|
|
|
- background: url("@/assets/images/login/login-bg.png") no-repeat 0 -120px;
|
|
|
|
|
|
|
+ background: url('@/assets/images/login/login-bg.png') no-repeat 0 -120px;
|
|
|
.bg-slot {
|
|
.bg-slot {
|
|
|
width: $carousel-width;
|
|
width: $carousel-width;
|
|
|
}
|
|
}
|