路由修改2
This commit is contained in:
		
							parent
							
								
									0f449ae06f
								
							
						
					
					
						commit
						132a6f6d30
					
				| 
						 | 
					@ -64,13 +64,27 @@ export const constantRoutes = [
 | 
				
			||||||
  {
 | 
					  {
 | 
				
			||||||
    path: '',
 | 
					    path: '',
 | 
				
			||||||
    component: Layout,
 | 
					    component: Layout,
 | 
				
			||||||
    redirect: '/index',
 | 
					    redirect: '/canteen/index',
 | 
				
			||||||
 | 
					    // children: [
 | 
				
			||||||
 | 
					    //   {
 | 
				
			||||||
 | 
					    //     path: 'index',
 | 
				
			||||||
 | 
					    //     component: () => import('@/views/index'),
 | 
				
			||||||
 | 
					    //     name: 'Index',
 | 
				
			||||||
 | 
					    //     meta: { title: '首页', icon: 'dashboard', affix: true }
 | 
				
			||||||
 | 
					    //   }
 | 
				
			||||||
 | 
					    // ]
 | 
				
			||||||
 | 
					  },
 | 
				
			||||||
 | 
					  {
 | 
				
			||||||
 | 
					    path: '/canteen',
 | 
				
			||||||
 | 
					    component: Layout,
 | 
				
			||||||
 | 
					    hidden: true,
 | 
				
			||||||
 | 
					    redirect: 'noredirect',
 | 
				
			||||||
    children: [
 | 
					    children: [
 | 
				
			||||||
      {
 | 
					      {
 | 
				
			||||||
        path: 'index',
 | 
					        path: 'index',
 | 
				
			||||||
        component: () => import('@/views/index'),
 | 
					        component: () => import('@/views/index_v1'),
 | 
				
			||||||
        name: 'Index',
 | 
					        name: 'Profile',
 | 
				
			||||||
        meta: { title: '首页', icon: 'dashboard', affix: true }
 | 
					        meta: { title: '食堂数据总览', icon: 'dashboard' }
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
    ]
 | 
					    ]
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -263,14 +263,14 @@ export default {
 | 
				
			||||||
              if (res.code===200){
 | 
					              if (res.code===200){
 | 
				
			||||||
                if (res.isLogin){
 | 
					                if (res.isLogin){
 | 
				
			||||||
                  this.$modal.confirm('账号已在其他地方登录是否继续登录!!!!').then(function() {
 | 
					                  this.$modal.confirm('账号已在其他地方登录是否继续登录!!!!').then(function() {
 | 
				
			||||||
                    return this.$router.push({ path: this.redirect || '/' });
 | 
					                    return this.$router.push({ path: this.redirect || '/canteen/index' });
 | 
				
			||||||
                  }).then(() => {
 | 
					                  }).then(() => {
 | 
				
			||||||
                    this.loading = false
 | 
					                    this.loading = false
 | 
				
			||||||
                  }).catch(() => {
 | 
					                  }).catch(() => {
 | 
				
			||||||
                    this.loading = false
 | 
					                    this.loading = false
 | 
				
			||||||
                  })
 | 
					                  })
 | 
				
			||||||
                }else {
 | 
					                }else {
 | 
				
			||||||
                  this.$router.push({ path: this.redirect || '/' });
 | 
					                  this.$router.push({ path: this.redirect || '/canteen/index' });
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
              }
 | 
					              }
 | 
				
			||||||
            })
 | 
					            })
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue