Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
haoban-operation-4
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
达摩4.0重构
haoban-operation-4
Commits
e3e851bb
Commit
e3e851bb
authored
Aug 18, 2020
by
caoyanzhi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update: 调整获取用户信息的接口
parent
69d640cf
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
21 deletions
+6
-21
index.js
src/api/index.js
+4
-11
yw-header.vue
src/layout/yw-header.vue
+2
-10
No files found.
src/api/index.js
View file @
e3e851bb
...
...
@@ -2,19 +2,12 @@ import getFetch from './get-fetch';
let
api
=
{
// 获取用户信息
getUserInfo
:
'/
user/userinfo
'
,
getUserInfo
:
'/
loginuser
'
,
// 登出
getLoginOut
:
'/logout'
};
let
api1
=
{
isLogin
:
{
url
:
'/login'
,
useIntercept
:
false
}
};
api
=
getFetch
(
api
,
'/gic-operation-web'
);
api1
=
getFetch
(
api1
,
'/hb-manage-operation-web'
);
api
=
getFetch
(
api
,
'/gic-authcenter'
);
export
default
{
...
api
,
...
api1
};
\ No newline at end of file
export
default
api
;
\ No newline at end of file
src/layout/yw-header.vue
View file @
e3e851bb
...
...
@@ -37,9 +37,9 @@
</
template
>
<
script
>
import
{
origin
,
succCode
}
from
'@/config'
;
import
{
origin
}
from
'@/config'
;
import
fetch
from
'@/api'
;
const
{
getUserInfo
,
getLoginOut
,
isLogin
}
=
fetch
;
const
{
getUserInfo
,
getLoginOut
}
=
fetch
;
export
default
{
name
:
'YwHeader'
,
data
()
{
...
...
@@ -55,18 +55,10 @@ export default {
methods
:
{
// 获取用户信息
getUserInfo
()
{
isLogin
().
then
(
res
=>
{
if
(
res
.
code
!=
succCode
)
{
window
.
location
.
href
=
`
${
origin
}
/hb-manage-operation-web/authcenter`
;
return
;
}
getUserInfo
().
then
(
res
=>
{
const
result
=
res
.
result
||
{};
this
.
userInfo
=
Object
.
assign
({},
result
);
this
.
$emit
(
'updateAsideMenu'
,
result
.
menuTree
||
[]);
}).
catch
(
e
=>
{
window
.
location
.
reload
();
});
});
},
// 退出登录
...
...
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