|  |  | @ -151,8 +151,12 @@ router.beforeEach((to, from, next) => { | 
			
		
	
		
			
				
					|  |  |  |   // 添加动态(菜单)路由
 | 
			
		
	
		
			
				
					|  |  |  |   // 已添加或者当前路由为页面路由, 可直接访问
 | 
			
		
	
		
			
				
					|  |  |  |   if (window.SITE_CONFIG['dynamicMenuRoutesHasAdded'] || fnCurrentRouteIsPageRoute(to, pageRoutes)) { | 
			
		
	
		
			
				
					|  |  |  |     if (to.name === 'detail' && to.query.doctorId) { | 
			
		
	
		
			
				
					|  |  |  |       loginByDocId(to.query.doctorId, next, to) | 
			
		
	
		
			
				
					|  |  |  |     } else { | 
			
		
	
		
			
				
					|  |  |  |       return next() | 
			
		
	
		
			
				
					|  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  |   } | 
			
		
	
		
			
				
					|  |  |  |   if (to.path === from.path) { | 
			
		
	
		
			
				
					|  |  |  |     return | 
			
		
	
		
			
				
					|  |  |  |   } | 
			
		
	
	
		
			
				
					|  |  | @ -161,6 +165,7 @@ router.beforeEach((to, from, next) => { | 
			
		
	
		
			
				
					|  |  |  |   } else if (to.name === '360view' && to.query.doctorId) { | 
			
		
	
		
			
				
					|  |  |  |     loginByDocId(to.query.doctorId, next, to.fullPath) | 
			
		
	
		
			
				
					|  |  |  |   } else { | 
			
		
	
		
			
				
					|  |  |  |     if (to.name === 'detail') return | 
			
		
	
		
			
				
					|  |  |  |     // 获取字典列表, 添加并全局变量保存
 | 
			
		
	
		
			
				
					|  |  |  |     // http.get('/sys/dict/type/all').then(({ data: res }) => {
 | 
			
		
	
		
			
				
					|  |  |  |     //   if (res.code !== 0) {
 | 
			
		
	
	
		
			
				
					|  |  | @ -178,7 +183,6 @@ router.beforeEach((to, from, next) => { | 
			
		
	
		
			
				
					|  |  |  |     }).catch(() => { | 
			
		
	
		
			
				
					|  |  |  |       return next({ name: 'login' }) | 
			
		
	
		
			
				
					|  |  |  |     }) | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |     // 获取菜单管理菜单列表,并添加动态路由
 | 
			
		
	
		
			
				
					|  |  |  |     http.get('/sys/menu/nav', { | 
			
		
	
		
			
				
					|  |  |  |       params: { | 
			
		
	
	
		
			
				
					|  |  | @ -195,7 +199,6 @@ router.beforeEach((to, from, next) => { | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |       next({ ...to, replace: true }) | 
			
		
	
		
			
				
					|  |  |  |     }).catch(() => { | 
			
		
	
		
			
				
					|  |  |  |       // console.log(123)
 | 
			
		
	
		
			
				
					|  |  |  |       return next({ name: 'login' }) | 
			
		
	
		
			
				
					|  |  |  |     }) | 
			
		
	
		
			
				
					|  |  |  |   } | 
			
		
	
	
		
			
				
					|  |  | @ -228,7 +231,7 @@ function muneList(next) { | 
			
		
	
		
			
				
					|  |  |  |     return next({ name: 'login' }) | 
			
		
	
		
			
				
					|  |  |  |   }) | 
			
		
	
		
			
				
					|  |  |  | } | 
			
		
	
		
			
				
					|  |  |  | function loginByDocId(doctorId, next) { | 
			
		
	
		
			
				
					|  |  |  | function loginByDocId(doctorId, next, to) { | 
			
		
	
		
			
				
					|  |  |  |   const params = { | 
			
		
	
		
			
				
					|  |  |  |     doctorId: doctorId | 
			
		
	
		
			
				
					|  |  |  |   } | 
			
		
	
	
		
			
				
					|  |  | @ -236,13 +239,14 @@ function loginByDocId(doctorId, next) { | 
			
		
	
		
			
				
					|  |  |  |     if (res.code !== 0) { | 
			
		
	
		
			
				
					|  |  |  |       return this.$message.error(res.msg) | 
			
		
	
		
			
				
					|  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  |     console.log(res) | 
			
		
	
		
			
				
					|  |  |  |     // Cookies.set('xa-token', res.data.token)
 | 
			
		
	
		
			
				
					|  |  |  |     debugger | 
			
		
	
		
			
				
					|  |  |  |     window.sessionStorage.setItem('xa-token', res.data.token) | 
			
		
	
		
			
				
					|  |  |  |     window.sessionStorage.setItem('qg-userData', JSON.stringify(res.data.currentUser)) | 
			
		
	
		
			
				
					|  |  |  |     if (to.name !== 'detail') { | 
			
		
	
		
			
				
					|  |  |  |       getNavList(next) | 
			
		
	
		
			
				
					|  |  |  |       muneList(next) | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  |     return next() | 
			
		
	
		
			
				
					|  |  |  |   }).catch(() => { }) | 
			
		
	
		
			
				
					|  |  |  | } | 
			
		
	
	
		
			
				
					|  |  | @ -287,7 +291,6 @@ function fnAddDynamicMenuRoutes(menuList = [], menuListChildLength, routes = []) | 
			
		
	
		
			
				
					|  |  |  |         iframeURL: URL | 
			
		
	
		
			
				
					|  |  |  |       }) | 
			
		
	
		
			
				
					|  |  |  |     } else { | 
			
		
	
		
			
				
					|  |  |  |       // console.log(URL)
 | 
			
		
	
		
			
				
					|  |  |  |       URL = URL.replace(/^\//, '').replace(/_/g, '-') | 
			
		
	
		
			
				
					|  |  |  |       item['path'] = '/' + URL.replace(/\//g, '-') | 
			
		
	
		
			
				
					|  |  |  |       item['name'] = URL.replace(/\//g, '-') | 
			
		
	
	
		
			
				
					|  |  | @ -297,7 +300,6 @@ function fnAddDynamicMenuRoutes(menuList = [], menuListChildLength, routes = []) | 
			
		
	
		
			
				
					|  |  |  |       item['component'] = () => Promise.resolve(require(`@/page-subspecialty/views/modules/${URL}`).default) | 
			
		
	
		
			
				
					|  |  |  |       // 如果是父级给父级添加重定向到子菜单第一项
 | 
			
		
	
		
			
				
					|  |  |  |       if (item.children.length > 0 && item.children[0].url) { | 
			
		
	
		
			
				
					|  |  |  |         // console.log(item)
 | 
			
		
	
		
			
				
					|  |  |  |         // isShow:0显示不菜单 1显示菜单
 | 
			
		
	
		
			
				
					|  |  |  |         item.children[0].isShow === 0 ? '' : item['redirect'] = '/' + item.children[0].url.replace(/\//g, '-') | 
			
		
	
		
			
				
					|  |  |  |       } | 
			
		
	
	
		
			
				
					|  |  | @ -321,7 +323,6 @@ function fnAddDynamicMenuRoutes(menuList = [], menuListChildLength, routes = []) | 
			
		
	
		
			
				
					|  |  |  |       }, | 
			
		
	
		
			
				
					|  |  |  |       { path: '*', redirect: { name: '404' }} | 
			
		
	
		
			
				
					|  |  |  |     ]) | 
			
		
	
		
			
				
					|  |  |  |     // console.log('----------------------')
 | 
			
		
	
		
			
				
					|  |  |  |     window.SITE_CONFIG['dynamicMenuRoutes'] = routes | 
			
		
	
		
			
				
					|  |  |  |     window.SITE_CONFIG['dynamicMenuRoutesHasAdded'] = true | 
			
		
	
		
			
				
					|  |  |  |   } | 
			
		
	
	
		
			
				
					|  |  | 
 |