Commit 63edb192 by 无尘

fix: 修改应用菜单

parent 65af4f96
......@@ -4,7 +4,7 @@
* @Author: 无尘
* @Date: 2020-07-16 16:37:05
* @LastEditors: 无尘
* @LastEditTime: 2020-09-18 15:08:09
* @LastEditTime: 2020-09-18 15:13:40
*/
import _import from './_import.js';
......
......@@ -4,7 +4,7 @@
* @Author: 无尘
* @Date: 2018-10-10 14:44:45
* @LastEditors: 无尘
* @LastEditTime: 2020-09-18 15:09:06
* @LastEditTime: 2020-09-18 15:13:22
-->
<template>
<div class="enterprise-wrap">
......@@ -84,24 +84,22 @@ export default {
};
getRoleMenu(para)
.then(async res => {
if (res.code == '0000') {
// 返回空数组
if (!res.result || !res.result.length) {
that.router.push('/app-list');
return false;
}
// 这里考虑有子级情况,后端接口返回是一个一个的菜单,不是父子级
that.appMenuData = await that.treeData(JSON.parse(JSON.stringify(res.result)));
if (that.appMenuData[0] && !!that.appMenuData[0].children && !!that.appMenuData[0].children.length && !!that.appMenuData[0].children[0].children && !!that.appMenuData[0].children[0].children.length) {
that.router.push(`${that.appMenuData[0].children[0].children[0].menuUrl}?applicationId=${that.$route.query.applicationId}`);
return false;
}
if (that.appMenuData[0] && !!that.appMenuData[0].children && !!that.appMenuData[0].children.length) {
that.router.push(`${that.appMenuData[0].children[0].menuUrl}?applicationId=${that.$route.query.applicationId}`);
return false;
}
that.router.push(`${that.appMenuData[0].menuUrl}?applicationId=${that.$route.query.applicationId}`);
// 返回空数组
if (!res.result || !res.result.length) {
that.router.push('/app-list');
return false;
}
// 这里考虑有子级情况,后端接口返回是一个一个的菜单,不是父子级
that.appMenuData = await that.treeData(JSON.parse(JSON.stringify(res.result)));
if (that.appMenuData[0] && !!that.appMenuData[0].children && !!that.appMenuData[0].children.length && !!that.appMenuData[0].children[0].children && !!that.appMenuData[0].children[0].children.length) {
that.router.push(`${that.appMenuData[0].children[0].children[0].menuUrl}?applicationId=${that.$route.query.applicationId}`);
return false;
}
if (that.appMenuData[0] && !!that.appMenuData[0].children && !!that.appMenuData[0].children.length) {
that.router.push(`${that.appMenuData[0].children[0].menuUrl}?applicationId=${that.$route.query.applicationId}`);
return false;
}
that.router.push(`${that.appMenuData[0].menuUrl}?applicationId=${that.$route.query.applicationId}`);
})
.catch(function(error) {
......
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