Commit f43e17b6 authored by 张俊's avatar 张俊

apaas菜单

parent a54c7392
...@@ -138,11 +138,11 @@ export default { ...@@ -138,11 +138,11 @@ export default {
getUserInfo() { getUserInfo() {
return this.$axios.get(`/apaas/system/v5/user/getUserInfo`); return this.$axios.get(`/apaas/system/v5/user/getUserInfo`);
}, },
getMenu() { getMenu(search) {
return this.$axios.get(`/apaas/system/v5/menu/user/tree`); return this.$axios.get(`/apaas/system/v5/menu/user/tree?search=${search}`);
}, },
getUser() { getUser() {
Promise.all([this.getUserInfo(), this.getMenu()]).then((res) => { Promise.all([this.getUserInfo(), this.getMenu('apaas')]).then((res) => {
if (res[0].data.code == 200 && res[1].data.code == 200) { if (res[0].data.code == 200 && res[1].data.code == 200) {
let data = res[1].data.data[0].children || []; let data = res[1].data.data[0].children || [];
this.$store.commit("setUserInfo", res[0].data.data); this.$store.commit("setUserInfo", res[0].data.data);
......
...@@ -44,8 +44,8 @@ function getUser() { ...@@ -44,8 +44,8 @@ function getUser() {
} }
//获取用户菜单信息 //获取用户菜单信息
function getMenu() { function getMenu(search) {
return axios.get(`/apaas/system/v5/menu/user/tree`) return axios.get(`/apaas/system/v5/menu/user/tree?search=${search}`)
} }
//处理菜单成为对象 //处理菜单成为对象
...@@ -60,7 +60,7 @@ function getMenuObj(menu,parentRowPath,menuObj){ ...@@ -60,7 +60,7 @@ function getMenuObj(menu,parentRowPath,menuObj){
} }
Promise.all([getUser(),getMenu()]).then(res => { Promise.all([getUser(),getMenu('apaas')]).then(res => {
console.log(res); console.log(res);
if (res[0].data.code == 200&&res[1].data.code == 200) { if (res[0].data.code == 200&&res[1].data.code == 200) {
//已登录则记录菜单和用户信息 //已登录则记录菜单和用户信息
......
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