Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
L
laravelzh
Project
Project
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
冯超鹏
laravelzh
Commits
1249f85b
Commit
1249f85b
authored
May 26, 2020
by
冯超鹏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
分解
parent
1b901a46
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
22 deletions
+18
-22
index.vue
resources/js/views/login/index.vue
+18
-22
No files found.
resources/js/views/login/index.vue
View file @
1249f85b
...
@@ -113,10 +113,12 @@ export default {
...
@@ -113,10 +113,12 @@ export default {
loginForm
:
{
loginForm
:
{
email
:
''
,
email
:
''
,
password
:
''
,
password
:
''
,
userOrAdmin
:
2
,
// 管理员
},
},
userloginForm
:
{
userloginForm
:
{
email
:
''
,
email
:
''
,
password
:
''
,
password
:
''
,
userOrAdmin
:
1
,
// 用户
},
},
loginRules
:
{
loginRules
:
{
email
:
[{
required
:
true
,
trigger
:
'blur'
,
validator
:
validateEmail
}],
email
:
[{
required
:
true
,
trigger
:
'blur'
,
validator
:
validateEmail
}],
...
@@ -167,6 +169,7 @@ export default {
...
@@ -167,6 +169,7 @@ export default {
}
else
if
(
this
.
loginForm
.
password
===
''
)
{
}
else
if
(
this
.
loginForm
.
password
===
''
)
{
this
.
$message
.
error
(
'密码不能为空'
);
this
.
$message
.
error
(
'密码不能为空'
);
}
else
{
}
else
{
localStorage
.
setItem
(
'userOrAdmin'
,
'2'
);
this
.
$prompt
(
'请输入登入口令'
,
'提示'
,
{
this
.
$prompt
(
'请输入登入口令'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
cancelButtonText
:
'取消'
,
...
@@ -197,28 +200,21 @@ export default {
...
@@ -197,28 +200,21 @@ export default {
}
}
},
},
userLogin
()
{
userLogin
()
{
// this.$router.push({ path: '/redirect' + 'user/userslist' });
if
(
this
.
userloginForm
.
email
===
''
)
{
// if (this.userloginForm.email === '') {
this
.
$message
.
error
(
'邮箱不能为空'
);
// this.$message.error('邮箱不能为空');
}
else
if
(
this
.
userloginForm
.
password
===
''
)
{
// } else if (this.userloginForm.password === '') {
this
.
$message
.
error
(
'密码不能为空'
);
// this.$message.error('密码不能为空');
}
else
{
// } else {
localStorage
.
setItem
(
'userOrAdmin'
,
'1'
);
// userlogin(this.userloginForm)
this
.
$store
.
dispatch
(
'user/login'
,
this
.
userloginForm
)
// .then(response => {
.
then
(()
=>
{
// this.$router.push({ path: '/user/userslist' });
this
.
$router
.
push
({
path
:
'/dashboard'
});
// })
this
.
loading
=
false
;
// .catch(err => {
})
// console.log(err);
.
catch
(()
=>
{
// });
this
.
loading
=
false
;
this
.
$store
.
dispatch
(
'user/userlogin'
,
this
.
userloginForm
)
});
.
then
(()
=>
{
}
this
.
$router
.
push
({
path
:
'/redirect'
+
'user/userslist'
});
this
.
loading
=
false
;
})
.
catch
(()
=>
{
this
.
loading
=
false
;
});
// }
},
},
},
},
};
};
...
...
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