9b7e125f
monkeyhouyi
属地页面
|
1
2
3
|
<template>
<div class="Login">
<div class="login-wrap">
|
88e239f9
“wangming”
1
|
4
|
<div class="login-wrap_header">内部系统</div>
|
9b7e125f
monkeyhouyi
属地页面
|
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
<div class="login-wrap_container">
<div class="welcome-text">欢迎登录!</div>
<el-form
ref="form"
:model="form"
:rules="rules"
class="login-wrap_container-form"
>
<el-form-item label="账号" prop="account">
<el-input
v-model="form.account"
placeholder="请输入账号"
></el-input>
</el-form-item>
<el-form-item label="密码" prop="password">
<el-input
type="password"
v-model="form.password"
placeholder="请输入密码"
autocomplete="off"
>
</el-input>
</el-form-item>
<div class="password-remind">
|
88e239f9
“wangming”
1
|
29
|
<!-- <registerForm>
|
9b7e125f
monkeyhouyi
属地页面
|
30
|
<div class="user-register">账户注册</div>
|
88e239f9
“wangming”
1
|
31
|
</registerForm> -->
|
9b7e125f
monkeyhouyi
属地页面
|
32
33
34
35
|
<div class="forget-password">
<!-- 忘记密码? -->
</div>
</div>
|
2201a66b
monkeyhouyi
专项性行动-首页联动
|
36
37
|
<el-button class="login-button" @click="toHome" :loading="loading">登录</el-button>
<!-- <div class="login-button" @click="toHome">
|
477ec56f
monkeyhouyi
权限
|
38
|
{{ loading ? "登录中。。。" : "登录" }}
|
2201a66b
monkeyhouyi
专项性行动-首页联动
|
39
|
</div> -->
|
9b7e125f
monkeyhouyi
属地页面
|
40
41
42
43
44
45
46
47
48
49
50
|
</el-form>
</div>
</div>
</div>
</template>
<script>
import { login } from "@/api/index";
import { setToken } from "@/utils/auth";
export default {
name: "Login",
|
477ec56f
monkeyhouyi
权限
|
51
52
53
54
55
|
components: {
loginLoading() {
return this.$store.state.user.loginLoading;
},
},
|
9b7e125f
monkeyhouyi
属地页面
|
56
57
58
|
data() {
return {
form: {
|
ff36c85d
monkeyhouyi
1
|
59
60
|
account: "wd", // cdoffice
password: "123456", // 123456
|
9b7e125f
monkeyhouyi
属地页面
|
61
62
63
64
65
|
},
rules: {
account: { required: true, message: "用户名不能为空", trigger: "blur" },
password: { required: true, message: "密码不能为空", trigger: "blur" },
},
|
477ec56f
monkeyhouyi
权限
|
66
|
loading: false,
|
9b7e125f
monkeyhouyi
属地页面
|
67
68
|
};
},
|
477ec56f
monkeyhouyi
权限
|
69
70
71
72
73
|
watch: {
loginLoading(val) {
if (!val) this.loading = false;
},
},
|
9eed2161
monkeyhouyi
修改线上消息提示失败
|
74
75
|
created() {
},
|
9b7e125f
monkeyhouyi
属地页面
|
76
77
78
|
mounted() {},
methods: {
toHome() {
|
477ec56f
monkeyhouyi
权限
|
79
80
|
if (this.loading) return;
|
9b7e125f
monkeyhouyi
属地页面
|
81
82
|
this.$refs["form"].validate((valid) => {
if (valid) {
|
477ec56f
monkeyhouyi
权限
|
83
84
85
86
87
|
this.loading = true;
this.$store.commit("SET_LOGIN_LOADING", true);
this.$store
.dispatch("Login", this.form)
.then(() => {
|
477ec56f
monkeyhouyi
权限
|
88
89
90
|
this.$router.push({ path: "/homePage" });
})
.catch(() => {
|
2201a66b
monkeyhouyi
专项性行动-首页联动
|
91
|
this.loading = false;
|
477ec56f
monkeyhouyi
权限
|
92
93
|
this.$store.commit("SET_LOGIN_LOADING", false);
});
|
9b7e125f
monkeyhouyi
属地页面
|
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
|
}
});
},
},
};
</script>
<style scoped lang="scss">
.Login {
width: 100%;
height: 100%;
background-image: url("@/assets/images/login_bg.png"); /* 替换为你的图片路径 */
background-size: cover; /* 背景图片覆盖整个元素 */
background-position: center; /* 背景图片居中 */
background-repeat: no-repeat; /* 不重复背景图片 */
.login-wrap {
width: 626px;
position: absolute;
top: 50%;
right: 8%;
transform: translateY(-50%);
.login-wrap_header {
width: 510px;
margin: 0 auto;
color: #5ed0fa;
font-size: 40px;
text-align: center;
}
.login-wrap_container {
width: 100%;
height: 520px;
padding: 64px 67px 67px;
box-sizing: border-box;
background-image: url("@/assets/images/login-box-container.png");
background-size: 100% 100%;
background-repeat: no-repeat;
text-align: left;
position: relative;
.welcome-text {
width: 392px;
margin: 0 auto 20px;
font-size: 20px;
font-weight: 700;
color: #5ed0fa;
}
.login-wrap_container-form {
width: 392px;
margin: 0 auto;
:deep(.el-form-item__label) {
font-size: 16px;
font-weight: 700;
color: #5ed0fa;
padding: 0;
}
:deep(.el-input__inner) {
background: none;
border: none;
border-bottom: 1px solid #5ed0fa;
padding: 0;
border-radius: 0;
color: #5ed0fa;
}
.password-remind {
width: 100%;
margin-bottom: 30px;
display: flex;
-webkit-box-pack: justify;
-ms-flex-pack: justify;
-webkit-box-align: center;
align-items: center;
justify-content: space-between;
.user-register {
color: #5ed0fa;
font-weight: 700;
cursor: pointer;
}
.forget-password {
color: #5ed0fa;
font-weight: 700;
cursor: pointer;
}
}
.login-button {
width: 100%;
height: 46px;
|
2201a66b
monkeyhouyi
专项性行动-首页联动
|
179
180
|
// line-height: 46px;
// text-align: center;
|
9b7e125f
monkeyhouyi
属地页面
|
181
182
183
|
background-image: url("@/assets/images/login-btn.png");
background-size: 100%;
background-repeat: no-repeat;
|
2201a66b
monkeyhouyi
专项性行动-首页联动
|
184
185
186
|
border-radius: 25px;
border: unset;
// cursor: pointer;
|
9b7e125f
monkeyhouyi
属地页面
|
187
188
189
190
191
192
193
194
|
color: #5ed0fa;
font-size: 18px;
}
}
}
}
}
</style>
|