jeecgboot-web前端首页更换,把默认首页/dashboard/analysis换为其他页面

  • Post author:
  • Post category:其他




问题描述

jeecg前端默认路径为/dashboard/analysis.vue为首页,需求想要改成自己的页面为首页



解决方法


把下述/dashboard/analysis相关的信息替换为自己页面信息即可



1.src/components/layouts/TabLayout.vue

`const indexKey = '/dashboard/analysis'`
	addIndexToFirst() {
	 this.pageList.splice(0, 0, {
	 name: 'dashboard-analysis',
	 path: indexKey,
	 fullPath: indexKey,
	 meta: {
	    icon: '',
	    title: '首页'
	 }
	})
	 this.linkList.splice(0, 0, indexKey)
	 },



2.src/components/menu/SideMenu.vue

增加钩子函数

    created() {
      if (this.menus && this.menus[0].path == '/dashboard/analysis') {
        this.menus.shift()
        console.info(this.menus)
      }
    },



3.src/components/tools/Breadcrumb.vue

这是导航条默认首页名字以及路由

 this.breadList.push({ name: 'dashboard-analysis', path: '/dashboard/analysis', meta: { title: '首页' } })



4.src/config/router.config.js

    path: '/',
    name: 'analysis',
    component: TabLayout,
    meta: { title: '首页' },
    redirect: '/dashboard/analysis',



5.src/store/mutation-types.js

  export const INDEX_MAIN_PAGE_PATH = '/dashboard/analysis'



6.src/utils/util.js

component: resolve => require(['@/components/layouts/TabLayout'], resolve),
          meta: { title: '首页' },
          redirect: '/dashboard/analysis',
          children: [
            ...generateChildRouters(data)
          ]



7.src/views/user/third/JeecgThirdLoginMixin.js

this.$router.push({ path: "/dashboard/analysis" }).catch(()=>{
        console.log('登录跳转首页出错,这个错误从哪里来的')
      })



8. src/views/user/Login.vue

 this.$router.push({ path: "/dashboard/analysis" }).catch(()=>{
          console.log('登录跳转首页出错,这个错误从哪里来的')
        })



版权声明:本文为qq_44114279原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。