|
|
@@ -1,487 +0,0 @@
|
|
1
|
|
-<template>
|
|
2
|
|
- <div class="page-login">
|
|
3
|
|
- <div class="page-login--layer page-login--layer-area">
|
|
4
|
|
- <ul class="circles">
|
|
5
|
|
- <li v-for="n in 10" :key="n"></li>
|
|
6
|
|
- </ul>
|
|
7
|
|
- </div>
|
|
8
|
|
-
|
|
9
|
|
- <div class="page-login--layer">
|
|
10
|
|
- <div
|
|
11
|
|
- class="page-login--content"
|
|
12
|
|
- flex="dir:top main:justify cross:stretch box:justify">
|
|
13
|
|
- <div class="page-login--content-header">
|
|
14
|
|
- <!-- <p class="page-login--content-header-motto" >
|
|
15
|
|
-
|
|
16
|
|
- {{ tips }}
|
|
17
|
|
- </p> -->
|
|
18
|
|
- </div>
|
|
19
|
|
- <div
|
|
20
|
|
- class="page-login--content-main"
|
|
21
|
|
- flex="dir:top main:center cross:center">
|
|
22
|
|
- <!-- logo -->
|
|
23
|
|
- <img class="page-login--logo" src="./image/logo.png">
|
|
24
|
|
- <!-- form -->
|
|
25
|
|
- <div class="page-login--form">
|
|
26
|
|
- <el-card shadow="never">
|
|
27
|
|
- <el-form
|
|
28
|
|
- ref="loginForm"
|
|
29
|
|
- label-position="top"
|
|
30
|
|
- :rules="rules"
|
|
31
|
|
- :model="formLogin"
|
|
32
|
|
- size="default">
|
|
33
|
|
- <el-form-item prop="username">
|
|
34
|
|
- <el-input
|
|
35
|
|
- type="text"
|
|
36
|
|
- v-model="formLogin.username"
|
|
37
|
|
- placeholder="用户名">
|
|
38
|
|
- <i slot="prepend" class="fa fa-user-circle-o"></i>
|
|
39
|
|
- </el-input>
|
|
40
|
|
- </el-form-item>
|
|
41
|
|
- <el-form-item prop="password">
|
|
42
|
|
- <el-input
|
|
43
|
|
- type="password"
|
|
44
|
|
- v-model="formLogin.password"
|
|
45
|
|
- placeholder="密码">
|
|
46
|
|
- <i slot="prepend" class="fa fa-keyboard-o"></i>
|
|
47
|
|
- </el-input>
|
|
48
|
|
- </el-form-item>
|
|
49
|
|
- <!-- <el-form-item prop="code">
|
|
50
|
|
- <el-input
|
|
51
|
|
- type="text"
|
|
52
|
|
- v-model="formLogin.code"
|
|
53
|
|
- placeholder="验证码">
|
|
54
|
|
- <template slot="append">
|
|
55
|
|
- <img class="login-code" src="./image/login-code.png">
|
|
56
|
|
- </template>
|
|
57
|
|
- </el-input>
|
|
58
|
|
- </el-form-item> -->
|
|
59
|
|
- <el-button
|
|
60
|
|
- size="default"
|
|
61
|
|
- @click="submit"
|
|
62
|
|
- type="primary"
|
|
63
|
|
- class="button-login">
|
|
64
|
|
- 登录
|
|
65
|
|
- </el-button>
|
|
66
|
|
- </el-form>
|
|
67
|
|
- </el-card>
|
|
68
|
|
- <p
|
|
69
|
|
- class="page-login--options"
|
|
70
|
|
- flex="main:justify cross:center">
|
|
71
|
|
- <!-- <span><d2-icon name="question-circle"/> 忘记密码</span>
|
|
72
|
|
- <span>注册用户</span> -->
|
|
73
|
|
- </p>
|
|
74
|
|
- <!-- quick login -->
|
|
75
|
|
- <!-- <el-button class="page-login--quick" size="default" type="info" @click="dialogVisible = true">
|
|
76
|
|
- 快速选择用户
|
|
77
|
|
- </el-button> -->
|
|
78
|
|
- </div>
|
|
79
|
|
- </div>
|
|
80
|
|
- <div class="page-login--content-footer">
|
|
81
|
|
- <!-- <p class="page-login--content-footer-locales">
|
|
82
|
|
- <a
|
|
83
|
|
- v-for="language in $languages"
|
|
84
|
|
- :key="language.value"
|
|
85
|
|
- @click="onChangeLocale(language.value)">
|
|
86
|
|
- {{ language.label }}
|
|
87
|
|
- </a>
|
|
88
|
|
- </p> -->
|
|
89
|
|
- <!-- <p class="page-login--content-footer-copyright">
|
|
90
|
|
- Copyright
|
|
91
|
|
- <d2-icon name="copyright"/>
|
|
92
|
|
- 紫光软件
|
|
93
|
|
- <a href="https://github.com/FairyEver">
|
|
94
|
|
- All Rights Reserved
|
|
95
|
|
- </a>
|
|
96
|
|
- </p> -->
|
|
97
|
|
- <!-- <p class="page-login--content-footer-options">
|
|
98
|
|
- <a href="#">帮助</a>
|
|
99
|
|
- <a href="#">隐私</a>
|
|
100
|
|
- <a href="#">条款</a>
|
|
101
|
|
- </p> -->
|
|
102
|
|
- <Foot></Foot>
|
|
103
|
|
- </div>
|
|
104
|
|
- </div>
|
|
105
|
|
- </div>
|
|
106
|
|
- <el-dialog
|
|
107
|
|
- title="快速选择用户"
|
|
108
|
|
- :visible.sync="dialogVisible"
|
|
109
|
|
- width="400px">
|
|
110
|
|
- <el-row :gutter="10" style="margin: -20px 0px -10px 0px;">
|
|
111
|
|
- <el-col v-for="(user, index) in users" :key="index" :span="8">
|
|
112
|
|
- <div class="page-login--quick-user" @click="handleUserBtnClick(user)">
|
|
113
|
|
- <d2-icon name="user-circle-o"/>
|
|
114
|
|
- <span>{{user.name}}</span>
|
|
115
|
|
- </div>
|
|
116
|
|
- </el-col>
|
|
117
|
|
- </el-row>
|
|
118
|
|
- </el-dialog>
|
|
119
|
|
- </div>
|
|
120
|
|
-</template>
|
|
121
|
|
-
|
|
122
|
|
-<script>
|
|
123
|
|
-
|
|
124
|
|
-import Foot from "../../../layout/header-aside/components/footer";
|
|
125
|
|
-import dayjs from 'dayjs'
|
|
126
|
|
-import { mapActions } from 'vuex'
|
|
127
|
|
-import localeMixin from '@/locales/mixin.js'
|
|
128
|
|
-export default {
|
|
129
|
|
- components: {Foot},
|
|
130
|
|
- mixins: [
|
|
131
|
|
- localeMixin
|
|
132
|
|
- ],
|
|
133
|
|
- data () {
|
|
134
|
|
- return {
|
|
135
|
|
-
|
|
136
|
|
-
|
|
137
|
|
- // 快速选择用户
|
|
138
|
|
- dialogVisible: false,
|
|
139
|
|
- users: [
|
|
140
|
|
- {
|
|
141
|
|
- name: 'Admin',
|
|
142
|
|
- username: 'admin',
|
|
143
|
|
- password: 'admin'
|
|
144
|
|
- },
|
|
145
|
|
- {
|
|
146
|
|
- name: 'Editor',
|
|
147
|
|
- username: 'editor',
|
|
148
|
|
- password: 'editor'
|
|
149
|
|
- },
|
|
150
|
|
- {
|
|
151
|
|
- name: 'User1',
|
|
152
|
|
- username: 'user1',
|
|
153
|
|
- password: 'user1'
|
|
154
|
|
- }
|
|
155
|
|
- ],
|
|
156
|
|
- // 表单
|
|
157
|
|
- formLogin: {
|
|
158
|
|
- username: 'admin',
|
|
159
|
|
- password: 'admin',
|
|
160
|
|
- code: 'v9am'
|
|
161
|
|
- },
|
|
162
|
|
- // 表单校验
|
|
163
|
|
- rules: {
|
|
164
|
|
- username: [
|
|
165
|
|
- {
|
|
166
|
|
- required: true,
|
|
167
|
|
- message: '请输入用户名',
|
|
168
|
|
- trigger: 'blur'
|
|
169
|
|
- }
|
|
170
|
|
- ],
|
|
171
|
|
- password: [
|
|
172
|
|
- {
|
|
173
|
|
- required: true,
|
|
174
|
|
- message: '请输入密码',
|
|
175
|
|
- trigger: 'blur'
|
|
176
|
|
- }
|
|
177
|
|
- ],
|
|
178
|
|
- code: [
|
|
179
|
|
- {
|
|
180
|
|
- required: true,
|
|
181
|
|
- message: '请输入验证码',
|
|
182
|
|
- trigger: 'blur'
|
|
183
|
|
- }
|
|
184
|
|
- ]
|
|
185
|
|
- },
|
|
186
|
|
-
|
|
187
|
|
- }
|
|
188
|
|
- },
|
|
189
|
|
- mounted () {
|
|
190
|
|
-
|
|
191
|
|
-
|
|
192
|
|
- },
|
|
193
|
|
-
|
|
194
|
|
- methods: {
|
|
195
|
|
- ...mapActions('d2admin/account', [
|
|
196
|
|
- 'login'
|
|
197
|
|
- ]),
|
|
198
|
|
- refreshTime () {
|
|
199
|
|
- this.time = dayjs().format('HH:mm:ss')
|
|
200
|
|
- },
|
|
201
|
|
- /**
|
|
202
|
|
- * @description 接收选择一个用户快速登录的事件
|
|
203
|
|
- * @param {Object} user 用户信息
|
|
204
|
|
- */
|
|
205
|
|
- handleUserBtnClick (user) {
|
|
206
|
|
- this.formLogin.username = user.username
|
|
207
|
|
- this.formLogin.password = user.password
|
|
208
|
|
- this.submit()
|
|
209
|
|
- },
|
|
210
|
|
- /**
|
|
211
|
|
- * @description 提交表单
|
|
212
|
|
- */
|
|
213
|
|
- // 提交登录信息
|
|
214
|
|
- submit () {
|
|
215
|
|
- this.$refs.loginForm.validate((valid) => {
|
|
216
|
|
- if (valid) {
|
|
217
|
|
- // 登录
|
|
218
|
|
- // 注意 这里的演示没有传验证码
|
|
219
|
|
- // 具体需要传递的数据请自行修改代码
|
|
220
|
|
- this.login({
|
|
221
|
|
- username: this.formLogin.username,
|
|
222
|
|
- password: this.formLogin.password
|
|
223
|
|
- })
|
|
224
|
|
- .then(() => {
|
|
225
|
|
- // 重定向对象不存在则返回顶层路径
|
|
226
|
|
- this.$router.replace(this.$route.query.redirect || '/')
|
|
227
|
|
- })
|
|
228
|
|
- } else {
|
|
229
|
|
- // 登录表单校验失败
|
|
230
|
|
- this.$message.error('表单校验失败,请检查')
|
|
231
|
|
- }
|
|
232
|
|
- })
|
|
233
|
|
- },
|
|
234
|
|
-
|
|
235
|
|
- }
|
|
236
|
|
-}
|
|
237
|
|
-</script>
|
|
238
|
|
-
|
|
239
|
|
-<style lang="scss">
|
|
240
|
|
-.page-login {
|
|
241
|
|
- @extend %unable-select;
|
|
242
|
|
- $backgroundColor: #F0F2F5;
|
|
243
|
|
- // ---
|
|
244
|
|
- background-color: $backgroundColor;
|
|
245
|
|
- background: url('./image/bg.png') center no-repeat ;
|
|
246
|
|
- background-size:100% 100%;
|
|
247
|
|
- height: 100%;
|
|
248
|
|
- position: relative;
|
|
249
|
|
- // 层
|
|
250
|
|
- .page-login--layer {
|
|
251
|
|
- @extend %full;
|
|
252
|
|
- overflow: auto;
|
|
253
|
|
- }
|
|
254
|
|
- .page-login--layer-area {
|
|
255
|
|
- overflow: hidden;
|
|
256
|
|
- }
|
|
257
|
|
- // 时间
|
|
258
|
|
- .page-login--layer-time {
|
|
259
|
|
- font-size: 24em;
|
|
260
|
|
- font-weight: bold;
|
|
261
|
|
- color: rgba(0, 0, 0, 0.03);
|
|
262
|
|
- overflow: hidden;
|
|
263
|
|
- }
|
|
264
|
|
- // 登陆页面控件的容器
|
|
265
|
|
- .page-login--content {
|
|
266
|
|
- height: 100%;
|
|
267
|
|
- min-height: 500px;
|
|
268
|
|
- }
|
|
269
|
|
- // header
|
|
270
|
|
- .page-login--content-header {
|
|
271
|
|
- padding: 1em 0;
|
|
272
|
|
- .page-login--content-header-motto {
|
|
273
|
|
- margin: 0px;
|
|
274
|
|
- padding: 0px;
|
|
275
|
|
- color: $color-text-normal;
|
|
276
|
|
- text-align: center;
|
|
277
|
|
- font-size: 12px;
|
|
278
|
|
- }
|
|
279
|
|
- }
|
|
280
|
|
- // main
|
|
281
|
|
- .page-login--logo {
|
|
282
|
|
- width: 240px;
|
|
283
|
|
- margin-bottom: 2em;
|
|
284
|
|
- margin-top: -2em;
|
|
285
|
|
- }
|
|
286
|
|
- // 登录表单
|
|
287
|
|
- .page-login--form {
|
|
288
|
|
- width: 280px;
|
|
289
|
|
- // 卡片
|
|
290
|
|
- .el-card {
|
|
291
|
|
- margin-bottom: 15px;
|
|
292
|
|
- }
|
|
293
|
|
- // 登录按钮
|
|
294
|
|
- .button-login {
|
|
295
|
|
- width: 100%;
|
|
296
|
|
- }
|
|
297
|
|
- // 输入框左边的图表区域缩窄
|
|
298
|
|
- .el-input-group__prepend {
|
|
299
|
|
- padding: 0px 14px;
|
|
300
|
|
- }
|
|
301
|
|
- .login-code {
|
|
302
|
|
- height: 40px - 2px;
|
|
303
|
|
- display: block;
|
|
304
|
|
- margin: 0px -20px;
|
|
305
|
|
- border-top-right-radius: 2px;
|
|
306
|
|
- border-bottom-right-radius: 2px;
|
|
307
|
|
- }
|
|
308
|
|
- // 登陆选项
|
|
309
|
|
- .page-login--options {
|
|
310
|
|
- margin: 0px;
|
|
311
|
|
- padding: 0px;
|
|
312
|
|
- font-size: 14px;
|
|
313
|
|
- color: $color-primary;
|
|
314
|
|
- margin-bottom: 15px;
|
|
315
|
|
- font-weight: bold;
|
|
316
|
|
- }
|
|
317
|
|
- .page-login--quick {
|
|
318
|
|
- width: 100%;
|
|
319
|
|
- }
|
|
320
|
|
- }
|
|
321
|
|
- // 快速选择用户面板
|
|
322
|
|
- .page-login--quick-user {
|
|
323
|
|
- @extend %flex-center-col;
|
|
324
|
|
- padding: 10px 0px;
|
|
325
|
|
- border-radius: 4px;
|
|
326
|
|
- &:hover {
|
|
327
|
|
- background-color: $color-bg;
|
|
328
|
|
- i {
|
|
329
|
|
- color: $color-text-normal;
|
|
330
|
|
- }
|
|
331
|
|
- span {
|
|
332
|
|
- color: $color-text-normal;
|
|
333
|
|
- }
|
|
334
|
|
- }
|
|
335
|
|
- i {
|
|
336
|
|
- font-size: 36px;
|
|
337
|
|
- color: $color-text-sub;
|
|
338
|
|
- }
|
|
339
|
|
- span {
|
|
340
|
|
- font-size: 12px;
|
|
341
|
|
- margin-top: 10px;
|
|
342
|
|
- color: $color-text-sub;
|
|
343
|
|
- }
|
|
344
|
|
- }
|
|
345
|
|
- // footer
|
|
346
|
|
- .page-login--content-footer {
|
|
347
|
|
- // padding: 1em 0;
|
|
348
|
|
- .page-login--content-footer-locales {
|
|
349
|
|
- padding: 0px;
|
|
350
|
|
- margin: 0px;
|
|
351
|
|
- margin-bottom: 15px;
|
|
352
|
|
- font-size: 12px;
|
|
353
|
|
- line-height: 12px;
|
|
354
|
|
- text-align: center;
|
|
355
|
|
- color: $color-text-normal;
|
|
356
|
|
- a {
|
|
357
|
|
- color: $color-text-normal;
|
|
358
|
|
- margin: 0 .5em;
|
|
359
|
|
- &:hover {
|
|
360
|
|
- color: $color-text-main;
|
|
361
|
|
- }
|
|
362
|
|
- }
|
|
363
|
|
- }
|
|
364
|
|
- .page-login--content-footer-copyright {
|
|
365
|
|
- padding: 0px;
|
|
366
|
|
- margin: 0px;
|
|
367
|
|
- margin-bottom: 10px;
|
|
368
|
|
- font-size: 12px;
|
|
369
|
|
- line-height: 12px;
|
|
370
|
|
- text-align: center;
|
|
371
|
|
- color: $color-text-normal;
|
|
372
|
|
- a {
|
|
373
|
|
- color: $color-text-normal;
|
|
374
|
|
- }
|
|
375
|
|
- }
|
|
376
|
|
- .page-login--content-footer-options {
|
|
377
|
|
- padding: 0px;
|
|
378
|
|
- margin: 0px;
|
|
379
|
|
- font-size: 12px;
|
|
380
|
|
- line-height: 12px;
|
|
381
|
|
- text-align: center;
|
|
382
|
|
- a {
|
|
383
|
|
- color: $color-text-normal;
|
|
384
|
|
- margin: 0 1em;
|
|
385
|
|
- }
|
|
386
|
|
- }
|
|
387
|
|
- }
|
|
388
|
|
- // 背景
|
|
389
|
|
- .circles {
|
|
390
|
|
- position: absolute;
|
|
391
|
|
- top: 0;
|
|
392
|
|
- left: 0;
|
|
393
|
|
- width: 100%;
|
|
394
|
|
- height: 100%;
|
|
395
|
|
- overflow: hidden;
|
|
396
|
|
- margin: 0px;
|
|
397
|
|
- padding: 0px;
|
|
398
|
|
- // li {
|
|
399
|
|
- // position: absolute;
|
|
400
|
|
- // display: block;
|
|
401
|
|
- // list-style: none;
|
|
402
|
|
- // width: 20px;
|
|
403
|
|
- // height: 20px;
|
|
404
|
|
- // background: #FFF;
|
|
405
|
|
- // animation: animate 25s linear infinite;
|
|
406
|
|
- // bottom: -200px;
|
|
407
|
|
- // @keyframes animate {
|
|
408
|
|
- // 0%{
|
|
409
|
|
- // transform: translateY(0) rotate(0deg);
|
|
410
|
|
- // opacity: 1;
|
|
411
|
|
- // border-radius: 0;
|
|
412
|
|
- // }
|
|
413
|
|
- // 100%{
|
|
414
|
|
- // transform: translateY(-1000px) rotate(720deg);
|
|
415
|
|
- // opacity: 0;
|
|
416
|
|
- // border-radius: 50%;
|
|
417
|
|
- // }
|
|
418
|
|
- // }
|
|
419
|
|
- // &:nth-child(1) {
|
|
420
|
|
- // left: 15%;
|
|
421
|
|
- // width: 80px;
|
|
422
|
|
- // height: 80px;
|
|
423
|
|
- // animation-delay: 0s;
|
|
424
|
|
- // }
|
|
425
|
|
- // &:nth-child(2) {
|
|
426
|
|
- // left: 5%;
|
|
427
|
|
- // width: 20px;
|
|
428
|
|
- // height: 20px;
|
|
429
|
|
- // animation-delay: 2s;
|
|
430
|
|
- // animation-duration: 12s;
|
|
431
|
|
- // }
|
|
432
|
|
- // &:nth-child(3) {
|
|
433
|
|
- // left: 70%;
|
|
434
|
|
- // width: 20px;
|
|
435
|
|
- // height: 20px;
|
|
436
|
|
- // animation-delay: 4s;
|
|
437
|
|
- // }
|
|
438
|
|
- // &:nth-child(4) {
|
|
439
|
|
- // left: 40%;
|
|
440
|
|
- // width: 60px;
|
|
441
|
|
- // height: 60px;
|
|
442
|
|
- // animation-delay: 0s;
|
|
443
|
|
- // animation-duration: 18s;
|
|
444
|
|
- // }
|
|
445
|
|
- // &:nth-child(5) {
|
|
446
|
|
- // left: 65%;
|
|
447
|
|
- // width: 20px;
|
|
448
|
|
- // height: 20px;
|
|
449
|
|
- // animation-delay: 0s;
|
|
450
|
|
- // }
|
|
451
|
|
- // &:nth-child(6) {
|
|
452
|
|
- // left: 75%;
|
|
453
|
|
- // width: 150px;
|
|
454
|
|
- // height: 150px;
|
|
455
|
|
- // animation-delay: 3s;
|
|
456
|
|
- // }
|
|
457
|
|
- // &:nth-child(7) {
|
|
458
|
|
- // left: 35%;
|
|
459
|
|
- // width: 200px;
|
|
460
|
|
- // height: 200px;
|
|
461
|
|
- // animation-delay: 7s;
|
|
462
|
|
- // }
|
|
463
|
|
- // &:nth-child(8) {
|
|
464
|
|
- // left: 50%;
|
|
465
|
|
- // width: 25px;
|
|
466
|
|
- // height: 25px;
|
|
467
|
|
- // animation-delay: 15s;
|
|
468
|
|
- // animation-duration: 45s;
|
|
469
|
|
- // }
|
|
470
|
|
- // &:nth-child(9) {
|
|
471
|
|
- // left: 20%;
|
|
472
|
|
- // width: 15px;
|
|
473
|
|
- // height: 15px;
|
|
474
|
|
- // animation-delay: 2s;
|
|
475
|
|
- // animation-duration: 35s;
|
|
476
|
|
- // }
|
|
477
|
|
- // &:nth-child(10) {
|
|
478
|
|
- // left: 85%;
|
|
479
|
|
- // width: 150px;
|
|
480
|
|
- // height: 150px;
|
|
481
|
|
- // animation-delay: 0s;
|
|
482
|
|
- // animation-duration: 11s;
|
|
483
|
|
- // }
|
|
484
|
|
- // }
|
|
485
|
|
- }
|
|
486
|
|
-}
|
|
487
|
|
-</style>
|