Commit e3e851bb by caoyanzhi

update: 调整获取用户信息的接口

parent 69d640cf
......@@ -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
......@@ -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();
});
});
},
// 退出登录
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment