Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
V
vipSupplier
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
王淑敏
vipSupplier
Commits
5a25f7d1
Commit
5a25f7d1
authored
Jul 28, 2020
by
初志鑫
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
简化userInfo接口
parent
0d2481de
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
7 deletions
+3
-7
src/api/user.js
+1
-4
src/store/modules/user.js
+2
-3
No files found.
src/api/user.js
View file @
5a25f7d1
...
@@ -13,13 +13,10 @@ export async function login(data) {
...
@@ -13,13 +13,10 @@ export async function login(data) {
});
});
}
}
export
function
getUserInfo
(
accessToken
)
{
export
function
getUserInfo
()
{
return
request
({
return
request
({
url
:
"/userInfo"
,
url
:
"/userInfo"
,
method
:
"post"
,
method
:
"post"
,
data
:
{
accessToken
,
},
});
});
}
}
...
...
src/store/modules/user.js
View file @
5a25f7d1
...
@@ -68,8 +68,8 @@ const actions = {
...
@@ -68,8 +68,8 @@ const actions = {
);
);
}
}
},
},
async
getUserInfo
({
commit
,
state
})
{
async
getUserInfo
({
commit
})
{
const
{
data
}
=
await
getUserInfo
(
state
.
accessToken
);
const
{
data
}
=
await
getUserInfo
();
if
(
!
data
)
{
if
(
!
data
)
{
Vue
.
prototype
.
$baseMessage
(
"验证失败,请重新登录..."
,
"error"
);
Vue
.
prototype
.
$baseMessage
(
"验证失败,请重新登录..."
,
"error"
);
return
false
;
return
false
;
...
@@ -87,7 +87,6 @@ const actions = {
...
@@ -87,7 +87,6 @@ const actions = {
},
},
async
logout
({
dispatch
})
{
async
logout
({
dispatch
})
{
await
logout
(
state
.
accessToken
);
await
logout
(
state
.
accessToken
);
await
dispatch
(
"tagsBar/delAllRoutes"
,
null
,
{
root
:
true
});
await
dispatch
(
"resetAccessToken"
);
await
dispatch
(
"resetAccessToken"
);
await
resetRouter
();
await
resetRouter
();
},
},
...
...
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