Commit e74514c9 authored by 张俊's avatar 张俊

调试登录

parent b9c6ee44
...@@ -60,11 +60,10 @@ export default { ...@@ -60,11 +60,10 @@ export default {
}, },
nowParent(){ nowParent(){
if(this.pageShow&&this.$store.state.userInfo){ if(this.pageShow&&this.$store.state.userInfo){
console.log(2222222) // console.log(2222222)
console.log(this.navMenu) // console.log(this.navMenu)
// return this.navMenu[this.rowPath.slice(1,4)] // console.log(this.rowPath)
// return this.pathToData(this.navMenu,this.rowPath) return this.navMenu[this.rowPath.slice(1,2)]
return this.navMenu[1]
}else{ }else{
return '' return ''
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
</router-link> </router-link>
<!-- 菜单 --> <!-- 菜单 -->
<div class="main-menu" v-if="userInfo&& userInfo.user"> <div class="main-menu" v-if="userInfo&& userInfo.system_id">
<!-- 前台菜单 --> <!-- 前台菜单 -->
<div class="font-menu" v-if="fontMenu&&fontMenu.length"> <div class="font-menu" v-if="fontMenu&&fontMenu.length">
<div class="nav-item" :style="path==item.path?{backgroundColor:'#2b4695'}:''" v-show="item.show" v-for="(item,index) in fontMenu" :key="'font'+index"> <div class="nav-item" :style="path==item.path?{backgroundColor:'#2b4695'}:''" v-show="item.show" v-for="(item,index) in fontMenu" :key="'font'+index">
...@@ -45,16 +45,17 @@ ...@@ -45,16 +45,17 @@
</div> </div>
</div> </div>
<div class="person-menu" v-if="userInfo&& userInfo.user"> <div class="person-menu" v-if="userInfo&& userInfo.system_id">
<!-- 信息 --> <!-- 信息 -->
<!-- 购物车 --> <!-- 购物车 -->
<!-- 用户中心 --> <!-- 用户中心 -->
<div class="user-center nav-item"> <div class="user-center nav-item">
<span class="user-icon"> <span class="user-icon">
<img style="width:24px;height:24px;border-radius:50%;vertical-align:middle;" :src="userInfo&&userInfo.headPortrait?userInfo.headPortrait:'/src/assets/imgs/home_ic_user.png'" /> <img style="width:24px;height:24px;border-radius:50%;vertical-align:middle;" v-if="userInfo&&userInfo.logo" :src="userInfo&&userInfo.logo" />
<img style="width:24px;height:24px;border-radius:50%;vertical-align:middle;" v-else src="../assets/imgs/home_ic_user.png" />
</span> </span>
<span class="user-name" v-if="userInfo && userInfo.user"> <span class="user-name" v-if="userInfo && userInfo.system_id">
{{ userInfo.name || userInfo.user }} {{ userInfo.system_account || userInfo.system_id }}
<bg-icon icon="#bg-ic-arrow-down" style="font-size:8px;margin-left: 3px;"></bg-icon> <bg-icon icon="#bg-ic-arrow-down" style="font-size:8px;margin-left: 3px;"></bg-icon>
</span> </span>
...@@ -62,9 +63,9 @@ ...@@ -62,9 +63,9 @@
请登录 请登录
</span> </span>
<div class="menu-virtual"></div> <div class="menu-virtual"></div>
<div v-if="userInfo && userInfo.user" class="menu-list"> <div v-if="userInfo && userInfo.system_id" class="menu-list">
<div <div
v-for="(item, index) in user_arr" v-for="(item, index) in systemMenu"
class="menu-item text_clip" class="menu-item text_clip"
:key="index + 700" :key="index + 700"
@click="menuAction(item.path,item)" @click="menuAction(item.path,item)"
...@@ -98,7 +99,6 @@ export default { ...@@ -98,7 +99,6 @@ export default {
data() { data() {
return { return {
documentScrollTop: 0, documentScrollTop: 0,
user_arr: [],
cartList: [], cartList: [],
showCart: true, showCart: true,
showShopMenu: false, showShopMenu: false,
...@@ -145,6 +145,15 @@ export default { ...@@ -145,6 +145,15 @@ export default {
} }
}); });
return temp return temp
},
systemMenu(state){
let temp = []
state.menu.forEach(e => {
if(e.menuType=='manager'){
temp.push(e)
}
});
return temp
} }
}) })
...@@ -201,18 +210,13 @@ export default { ...@@ -201,18 +210,13 @@ export default {
let path = this.$route.path; let path = this.$route.path;
window.location.href = `/login?redirect=${path}`; window.location.href = `/login?redirect=${path}`;
} else { } else {
//true 同区域跳转 //是否有子路由,有则寻找子路由的第一个进行跳转,无则直接进行跳转
//false 跨系统跳转 //使用childMenuAction是模拟template中,子路径点击跳转使用childMenuAction,
if(parent.menuType==this.$store.state.menuObj[this.path].menuType){ //防止出现层级错误的问题
this.$router.push(n); if(parent.children&&parent.children.length){
this.childMenuAction(parent.children[0],parent)
}else{ }else{
let temp = '' this.pathToUrl(n,parent)
if(this.$store.state.menuObj[n].menuType=='font'||this.$store.state.menuObj[n].menuType=='system'){
temp = '/apaas/ui/#'
}else if(this.$store.state.menuObj[n].menuType=='manager'){
temp = '/apaas/system/ui/#'
}
window.location.href = temp+n
} }
} }
}, },
...@@ -238,17 +242,16 @@ export default { ...@@ -238,17 +242,16 @@ export default {
if(path.includes('http')){ if(path.includes('http')){
window.open(path,'_blank') window.open(path,'_blank')
}else{ }else{
debugger
//判断是否是同区域内跳转 //判断是否是同区域内跳转
//非同区域跳转需要改前缀,如apaas/ui跳转到apaas/manager //非同区域跳转需要改前缀,如apaas/ui跳转到apaas/manager
if(parent.menuType==this.$store.state.menuObj[this.path].menuType){ if(this.$store.state.menuObj[this.path]&&parent.menuType==this.$store.state.menuObj[this.path].menuType){
this.$router.push(path); this.$router.push(path);
}else{ }else{
let temp = '' let temp = ''
if(this.$store.state.menuObj[path].menuType=='font'||this.$store.state.menuObj[path].menuType=='system'){ if(this.$store.state.menuObj[path].menuType=='font'||this.$store.state.menuObj[path].menuType=='system'){
temp = '/apaas/ui/#' temp = '/apaas/portal/ui/#'
}else if(this.$store.state.menuObj[path].menuType=='manager'){ }else if(this.$store.state.menuObj[path].menuType=='manager'){
temp = '/apaas/system/ui/#' temp = '/apaas/manage/ui/#'
} }
window.location.href = temp+path window.location.href = temp+path
} }
......
...@@ -90,7 +90,9 @@ export default { ...@@ -90,7 +90,9 @@ export default {
this.$store.commit('setMenuObj',menuObj) this.$store.commit('setMenuObj',menuObj)
// } // }
generateRoutes() generateRoutes()
this.$router.push("/"); // this.$router.push("/");
//跳转到工作台页面
window.location.href = '/apaas/portal/ui/#/'
} }
}); });
}, },
......
...@@ -6,7 +6,6 @@ var adminMenu = [ ...@@ -6,7 +6,6 @@ var adminMenu = [
name:"workspace", name:"workspace",
menuType:'system', //system:apaas后管,能力注册页等 font:apaas前台页 manager:apaas管理中心 menuType:'system', //system:apaas后管,能力注册页等 font:apaas前台页 manager:apaas管理中心
show:true, show:true,
level:1,
children:[{ children:[{
menuName: "能力管理", menuName: "能力管理",
path: "/ability-manage", path: "/ability-manage",
...@@ -154,15 +153,21 @@ var adminMenu = [ ...@@ -154,15 +153,21 @@ var adminMenu = [
} }
] ]
}, },
{
{ name:"index",
menuName:"首页",
path: "/",
parentPath:null,
menuType:'font',
show:true,
},
{
menuName: "管理中心", menuName: "管理中心",
path: "/manage", path: "/manage",
name:"manage", name:"manage",
parentPath:null, parentPath:null,
menuType:'manager', menuType:'manager',
show: true, show: true,
level:1,
children:[{ children:[{
menuName: "开发管理", menuName: "开发管理",
path: "/develop", path: "/develop",
...@@ -202,7 +207,6 @@ var adminMenu = [ ...@@ -202,7 +207,6 @@ var adminMenu = [
show:true, show:true,
path: "/develop/menu", path: "/develop/menu",
}, },
] ]
}, },
{ {
...@@ -283,18 +287,8 @@ var adminMenu = [ ...@@ -283,18 +287,8 @@ var adminMenu = [
] ]
}, },
] ]
}, },
{
name:"index",
menuName:"首页",
path: "/",
parentPath:null,
menuType:'font',
level:1,
show:true,
},
] ]
...@@ -303,19 +297,19 @@ function getViews(path) { ...@@ -303,19 +297,19 @@ function getViews(path) {
let pathArr = path.split('/') let pathArr = path.split('/')
let modules = {} let modules = {}
switch (pathArr.length) { switch (pathArr.length) {
case 2: case 2:
modules = import.meta.glob('../page/main/**/*.vue') modules = import.meta.glob('../page/main/**/*.vue')
break; break;
case 3: case 3:
modules = import.meta.glob('../page/main/**/*/*.vue') modules = import.meta.glob('../page/main/**/*/*.vue')
break; break;
case 4: case 4:
modules = import.meta.glob('../page/main/**/**/*/*.vue') modules = import.meta.glob('../page/main/**/**/*/*.vue')
break; break;
case 5: case 5:
modules = import.meta.glob('../page/main/**/**/**/*/*.vue') modules = import.meta.glob('../page/main/**/**/**/*/*.vue')
break; break;
default: default:
break; break;
} }
// 然后动态路由的时候这样来取 // 然后动态路由的时候这样来取
...@@ -326,29 +320,24 @@ return modules['../page/main' + path + '/index.vue'] ...@@ -326,29 +320,24 @@ return modules['../page/main' + path + '/index.vue']
//处理路由方法 //处理路由方法
var menuToRouter = (menu)=>{ var menuToRouter = (menu)=>{
menu.forEach(e => { menu.forEach(e => {
//第一层级是最上层菜单,有相应的菜单可以点击查看 if(e.children){
if(e.children&&e.level==1){
console.log(`@/page/main${e.path}/index.vue`);
e.component= getViews(e.path)
menuToRouter(e.children)
}else if(e.children){
// 其他层级作为文件夹,只提供父级 // 其他层级作为文件夹,只提供父级
e.component = () => import('../page/parent/parent.vue') e.component = () => import('../page/parent/parent.vue')
menuToRouter(e.children) menuToRouter(e.children)
}else{ }else{
console.log(`@/page/main${e.path}/index.vue`); console.log(`@/page/main${e.path}/index.vue`);
//叶子层级需要加载到对应文件 //叶子层级需要加载到对应文件
//对首页做兼容 //对首页做兼容
if(e.path=='/'){ if(e.path=='/'){
e.component = () => import('../page/main/develop/account/index.vue') e.component = () => import('../page/main/index/index.vue')
}else{ }else{
e.component= getViews(e.path) e.component= getViews(e.path)
} }
} }
}); });
} }
export default { export default {
adminMenu, adminMenu,
menuToRouter menuToRouter
} }
\ No newline at end of file
...@@ -895,11 +895,6 @@ is-url@^1.2.4: ...@@ -895,11 +895,6 @@ is-url@^1.2.4:
resolved "https://registry.npmmirror.com/is-url/-/is-url-1.2.4.tgz#04a4df46d28c4cff3d73d01ff06abeb318a1aa52" resolved "https://registry.npmmirror.com/is-url/-/is-url-1.2.4.tgz#04a4df46d28c4cff3d73d01ff06abeb318a1aa52"
integrity sha512-ITvGim8FhRiYe4IQ5uHSkj7pVaPDrCTkNd3yq3cV7iZAcJdHTUMPMEHcqSOy9xZ9qFenQCvi+2wjH9a1nXqHww== integrity sha512-ITvGim8FhRiYe4IQ5uHSkj7pVaPDrCTkNd3yq3cV7iZAcJdHTUMPMEHcqSOy9xZ9qFenQCvi+2wjH9a1nXqHww==
js-md5@^0.7.3:
version "0.7.3"
resolved "https://mirrors.cloud.tencent.com/npm/js-md5/-/js-md5-0.7.3.tgz#b4f2fbb0b327455f598d6727e38ec272cd09c3f2"
integrity sha512-ZC41vPSTLKGwIRjqDh8DfXoCrdQIyBgspJVPXHBGu4nZlAEvG3nf+jO9avM9RmLiGakg7vz974ms99nEV0tmTQ==
lodash-es@^4.17.21: lodash-es@^4.17.21:
version "4.17.21" version "4.17.21"
resolved "https://registry.npmmirror.com/lodash-es/-/lodash-es-4.17.21.tgz" resolved "https://registry.npmmirror.com/lodash-es/-/lodash-es-4.17.21.tgz"
......
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