优化路由
This commit is contained in:
parent
34911c5d66
commit
a583b23e03
|
@ -6,7 +6,7 @@ import Bus from '@/assets/eventBus.js'
|
||||||
import Subnav from '@/components/subnav/main'
|
import Subnav from '@/components/subnav/main'
|
||||||
import { Avatar, Pop, Sweetalert, Dialog, Icon, Notify } from 'zent'
|
import { Avatar, Pop, Sweetalert, Dialog, Icon, Notify } from 'zent'
|
||||||
import ModifySelfpwd from './ModifySelfpwd'
|
import ModifySelfpwd from './ModifySelfpwd'
|
||||||
import { router, navRoute } from '@/router/index'
|
import { router, navRoute, noShowSubMenu } from '@/router/index'
|
||||||
|
|
||||||
import {
|
import {
|
||||||
getUserinfo,
|
getUserinfo,
|
||||||
|
@ -24,13 +24,6 @@ export default class App extends Component {
|
||||||
setrender: 1,
|
setrender: 1,
|
||||||
linkshow: '系统管理',
|
linkshow: '系统管理',
|
||||||
isShowSub: true,
|
isShowSub: true,
|
||||||
noShowSubMenu: [
|
|
||||||
'/home/extension',
|
|
||||||
'/home/overview',
|
|
||||||
'/home/plan-create',
|
|
||||||
'/home/mytempMould',
|
|
||||||
'/home/edittemplate'
|
|
||||||
],
|
|
||||||
pathname: '',
|
pathname: '',
|
||||||
userInfo: {},
|
userInfo: {},
|
||||||
navlist: navRoute
|
navlist: navRoute
|
||||||
|
@ -44,7 +37,7 @@ export default class App extends Component {
|
||||||
Bus.addListener('closeMask', (prop) => {
|
Bus.addListener('closeMask', (prop) => {
|
||||||
this.setState({ mouseMenuMask: prop })
|
this.setState({ mouseMenuMask: prop })
|
||||||
})
|
})
|
||||||
if (this.state.noShowSubMenu.indexOf(this.props.location.pathname) > -1) {
|
if (noShowSubMenu.indexOf(this.props.location.pathname) > -1) {
|
||||||
this.setState({ isShowSub: false })
|
this.setState({ isShowSub: false })
|
||||||
} else {
|
} else {
|
||||||
this.setState({ isShowSub: true })
|
this.setState({ isShowSub: true })
|
||||||
|
@ -133,7 +126,7 @@ export default class App extends Component {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.state.noShowSubMenu.indexOf(nextProps.location.pathname) > -1) {
|
if (noShowSubMenu.indexOf(nextProps.location.pathname) > -1) {
|
||||||
this.setState({ isShowSub: false })
|
this.setState({ isShowSub: false })
|
||||||
} else {
|
} else {
|
||||||
this.setState({ isShowSub: true })
|
this.setState({ isShowSub: true })
|
||||||
|
|
|
@ -46,7 +46,7 @@ import DistriButorEdit from '@/pages/distributor/add/add'
|
||||||
import MyTempMouldAdd from '@/pages/exchangepage/template/main.js'
|
import MyTempMouldAdd from '@/pages/exchangepage/template/main.js'
|
||||||
import MyExChangeTemplate from '@/pages/exchangepage/mytemplate/main.js'
|
import MyExChangeTemplate from '@/pages/exchangepage/mytemplate/main.js'
|
||||||
import CopyCode from '@/pages/exchangecode/copyCode/index'
|
import CopyCode from '@/pages/exchangecode/copyCode/index'
|
||||||
|
/* 基础路由 */
|
||||||
const router = [
|
const router = [
|
||||||
{
|
{
|
||||||
path: '/home/extension',
|
path: '/home/extension',
|
||||||
|
@ -250,6 +250,7 @@ const router = [
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
|
/* 导航现实路由 */
|
||||||
const navRoute = [
|
const navRoute = [
|
||||||
{
|
{
|
||||||
name: '系统管理',
|
name: '系统管理',
|
||||||
|
@ -326,4 +327,13 @@ const navRoute = [
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
export { router, navRoute }
|
/* 不显示路由 */
|
||||||
|
const noShowSubMenu = [
|
||||||
|
'/home/extension',
|
||||||
|
'/home/overview',
|
||||||
|
'/home/plan-create',
|
||||||
|
'/home/mytempMould',
|
||||||
|
'/home/edittemplate'
|
||||||
|
]
|
||||||
|
|
||||||
|
export { router, navRoute, noShowSubMenu }
|
||||||
|
|
Loading…
Reference in New Issue