Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gs1
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
吴迪
gs1
Commits
c39e279a
Commit
c39e279a
authored
Oct 07, 2021
by
tang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 登录优化
parent
57357940
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
6 deletions
+43
-6
login.vue
src/views/User/login.vue
+43
-6
No files found.
src/views/User/login.vue
View file @
c39e279a
...
@@ -3,20 +3,27 @@
...
@@ -3,20 +3,27 @@
<div
class=
"login"
>
<div
class=
"login"
>
<el-tabs
v-model=
"activeName"
class=
"tab-no-bottom"
>
<el-tabs
v-model=
"activeName"
class=
"tab-no-bottom"
>
<el-tab-pane
label=
"用户名登录"
name=
"first"
>
<el-tab-pane
label=
"用户名登录"
name=
"first"
>
<el-form
:model=
"userForm"
status-icon
>
<el-form
:model=
"userForm"
status-icon
ref=
"userLoginFormRef"
>
<el-form-item>
<el-form-item
prop=
"userName"
:rules=
"[
{ required: true, message: '请输入用户名/条码卡号', trigger: 'blur' }]"
>
<el-input
v-model=
"userForm.userName"
<el-input
v-model=
"userForm.userName"
placeholder=
"请输入用户名/条码卡号"
></el-input>
placeholder=
"请输入用户名/条码卡号
(test)
"
></el-input>
</el-form-item>
</el-form-item>
<el-form-item>
<el-form-item
prop=
"password"
:rules=
"[
{ required: true, message: '请输入密码', trigger: 'blur' }]"
>
<el-input
type=
"password"
<el-input
type=
"password"
v-model=
"userForm.password"
v-model=
"userForm.password"
placeholder=
"请输入密码"
placeholder=
"请输入密码
(test)
"
autocomplete=
"off"
></el-input>
autocomplete=
"off"
></el-input>
</el-form-item>
</el-form-item>
<el-form-item
class=
"validate-append"
>
<el-form-item
class=
"validate-append"
prop=
"validateCode"
:rules=
"[
{ required: true, message: '请输入验证码', trigger: 'blur' }]"
>
<el-input
<el-input
v-model=
"userForm.validateCode"
v-model=
"userForm.validateCode"
placeholder=
"请输入验证码"
placeholder=
"请输入验证码"
...
@@ -25,6 +32,10 @@
...
@@ -25,6 +32,10 @@
</el-input>
</el-input>
</el-form-item>
</el-form-item>
<div
v-if=
"showUserLoginError"
class=
"login-error"
>
{{ userLoginError }}
</div>
<el-form-item>
<el-form-item>
<el-button
type=
"primary"
@
click=
"loginByUser"
style=
"width: 100%"
>
登 录
</el-button>
<el-button
type=
"primary"
@
click=
"loginByUser"
style=
"width: 100%"
>
登 录
</el-button>
</el-form-item>
</el-form-item>
...
@@ -80,6 +91,8 @@ export default {
...
@@ -80,6 +91,8 @@ export default {
components
:
{
EntryCard
},
components
:
{
EntryCard
},
data
()
{
data
()
{
return
{
return
{
showUserLoginError
:
false
,
userLoginError
:
''
,
hasSent
:
false
,
hasSent
:
false
,
timer
:
null
,
timer
:
null
,
time
:
60
,
time
:
60
,
...
@@ -97,6 +110,23 @@ export default {
...
@@ -97,6 +110,23 @@ export default {
},
},
methods
:
{
methods
:
{
loginByUser
()
{
loginByUser
()
{
this
.
$refs
[
'userLoginFormRef'
].
validate
((
valid
)
=>
{
if
(
valid
)
{
if
(
this
.
userForm
.
validateCode
===
'kjjj'
)
{
if
(
this
.
userForm
.
userName
===
'test'
&&
this
.
userForm
.
password
===
'test'
)
{
this
.
$router
.
push
({
path
:
'/home'
})
}
else
{
this
.
userLoginError
=
'用户名或密码不正确!'
}
}
else
{
this
.
userLoginError
=
'验证码不正确!'
this
.
showUserLoginError
=
true
;
}
}
else
{
console
.
log
(
'error submit!!'
);
return
false
;
}
});
},
},
loginByMobile
()
{
loginByMobile
()
{
...
@@ -171,6 +201,13 @@ export default {
...
@@ -171,6 +201,13 @@ export default {
}
}
}
}
}
}
.login-error
{
margin-bottom
:
10px
;
font-size
:
12px
;
font-weight
:
400
;
color
:
rgb
(
242
,
53
,
53
);
}
}
}
@media
(
max-width
:
456px
)
{
@media
(
max-width
:
456px
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment