index.vue
2.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
<script setup lang="ts">
import { setToken } from '@/utils/auth';
import PhoneContent from '@/views/login/components/phone-content.vue';
import { Message } from '@arco-design/web-vue';
import { useRouter } from 'vue-router';
type LoginData = { access_token: string; refresh_token: string; nick_name: string };
const router = useRouter();
const onLogin = ({ access_token, refresh_token, nick_name }: LoginData) => {
setToken(access_token, refresh_token);
Message.success(`欢迎回来,管理员:${nick_name}`);
const { path } = router.currentRoute.value.query;
// router.replace((path as string) || '/dashboard');
router.replace((path as string) || '/demos');
};
</script>
<template>
<div class="container">
<div class="banner">
<div class="banner-inner"></div>
</div>
<div class="content">
<div class="content-inner">
<div class="login-form-wrapper">
<div class="login-form-title">泡泡留声</div>
<div class="login-form-sub-title">个人管理后台</div>
<a-card :bordered="true" :hoverable="true">
<a-tabs size="small" :justify-="true" :animation="true" lazy-load>
<a-tab-pane key="phone" title="手机号">
<phone-content @login="onLogin" />
</a-tab-pane>
</a-tabs>
</a-card>
</div>
</div>
</div>
</div>
</template>
<style lang="less" scoped>
.container {
display: flex;
height: 100vh;
.banner {
width: 550px;
}
.content {
position: relative;
display: flex;
flex: 1;
align-items: center;
justify-content: center;
padding-bottom: 40px;
.login-form-wrapper {
width: 380px;
}
.login-form-title {
color: var(--color-text-1);
font-weight: 500;
font-size: 30px;
line-height: 46px;
text-align: center;
}
.login-form-sub-title {
color: var(--color-text-3);
font-size: 16px;
line-height: 24px;
text-align: center;
margin-bottom: 16px;
}
}
.footer {
position: absolute;
right: 0;
bottom: 0;
width: 100%;
}
}
.banner {
display: flex;
align-items: center;
justify-content: center;
&-inner {
flex: 1;
height: 100%;
background-image: url('assets/image/user-login-bg.jpg');
background-size: cover;
}
}
</style>