Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
DA-Platform
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
文档服务地址:
http://47.92.0.57:3000/
周报索引地址:
http://47.92.0.57:3000/s/NruNXRYmV
Open sidebar
Berlin
DA-Platform
Commits
c1cd5cc6
Commit
c1cd5cc6
authored
May 30, 2020
by
Wang Yuhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改Login.vue
parent
c00a69a5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
35 deletions
+26
-35
Login.vue
DAPlatform-front/src/components/Login.vue
+26
-35
No files found.
DAPlatform-front/src/components/Login.vue
View file @
c1cd5cc6
...
...
@@ -66,6 +66,18 @@ export default {
type
:
this
.
password
?
1
:
0
}
this
.
$store
.
commit
(
'setUserInfo'
,
userInfo
)
// 登录接口
this
.
axios
.
post
(
'/signin'
,
{
userName
:
this
.
userName
,
password
:
this
.
password
}).
then
(
res
=>
{
if
(
res
.
code
===
1
)
{
// 存储用户ID和身份
// 跳转页面
this
.
$router
.
push
({
path
:
'/taskHall'
})
}
else
if
(
res
.
code
===
0
)
{
alert
(
'用户名或密码错误'
)
}
})
this
.
$router
.
push
(
'/index'
).
catch
(
data
=>
{})
},
register
()
{
...
...
@@ -74,6 +86,20 @@ export default {
type
:
this
.
password
?
1
:
0
}
this
.
$store
.
commit
(
'setUserInfo'
,
userInfo
)
this
.
axios
.
post
(
'/signup'
,
{
userName
:
this
.
userName
,
password
:
this
.
password
,
email
:
this
.
email
}).
then
(
res
=>
{
if
(
res
.
code
===
1
)
{
// 存储用户ID和身份
// 跳转至用户大厅
this
.
$router
.
push
({
path
:
'/taskHall'
})
}
else
if
(
res
.
code
===
0
)
{
alert
(
'注册失败'
)
}
window
.
reload
()
})
this
.
$router
.
push
(
'/index'
).
catch
(
data
=>
{})
}
}
...
...
@@ -153,38 +179,3 @@ export default {
}
}
</
style
>
<!--axios函数功能-->
<
script
src=
"https://cdn.staticfile.org/axios/0.18.0/axios.min.js"
></
script
>
<
script
>
const
mock
=
true
if
(
mock
)
require
(
'@/mock/api.js'
)
//登录
axios
.
post
(
"/signin"
,{
userName
:
this
.
userName
,
password
:
this
.
password
}).
then
(
res
=>
{
if
(
res
.
code
==
1
){
//存储用户ID和身份
// 跳转页面
this
.
$router
.
push
({
path
:
"/taskHall"
});
}
else
if
(
res
.
code
==
0
)
alert
(
"用户名或密码错误"
);
}),
axios
.
post
(
"/signup"
,{
userName
:
this
.
userName
,
password
:
this
.
password
,
email
:
this
.
email
,
}).
then
(
res
=>
{
if
(
res
.
code
==
1
){
//存储用户ID和身份
//跳转至用户大厅
this
.
$router
.
push
({
path
:
"/taskHall"
});
}
else
if
(
res
.
code
==
0
)
alert
(
"注册失败"
);
window
.
reload
();
})
</
script
>
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