feat: router
							parent
							
								
									6df5bd0060
								
							
						
					
					
						commit
						22a69be371
					
				|  | @ -0,0 +1,39 @@ | |||
| import type { RouteRecordRaw } from 'vue-router'; | ||||
| 
 | ||||
| const routes: RouteRecordRaw[] = [ | ||||
|   { | ||||
|     path: '/infra/job/job-log', | ||||
|     component: () => import('#/views/infra/job/logger/index.vue'), | ||||
|     name: 'InfraJobLog', | ||||
|     meta: { | ||||
|       title: '调度日志', | ||||
|       icon: 'ant-design:history-outlined', | ||||
|       activePath: '/infra/job', | ||||
|       keepAlive: false, | ||||
|       hideInMenu: true, | ||||
|     }, | ||||
|   }, | ||||
|   { | ||||
|     path: '/codegen', | ||||
|     name: 'CodegenEdit', | ||||
|     meta: { | ||||
|       title: '代码生成', | ||||
|       icon: 'ic:baseline-view-in-ar', | ||||
|       keepAlive: true, | ||||
|       hideInMenu: true, | ||||
|     }, | ||||
|     children: [ | ||||
|       { | ||||
|         path: '/codegen/edit', | ||||
|         name: 'InfraCodegenEdit', | ||||
|         component: () => import('#/views/infra/codegen/edit/index.vue'), | ||||
|         meta: { | ||||
|           title: '修改生成配置', | ||||
|           activeMenu: '/infra/codegen', | ||||
|         }, | ||||
|       }, | ||||
|     ], | ||||
|   }, | ||||
| ]; | ||||
| 
 | ||||
| export default routes; | ||||
|  | @ -0,0 +1,16 @@ | |||
| import type { RouteRecordRaw } from 'vue-router'; | ||||
| 
 | ||||
| const routes: RouteRecordRaw[] = [ | ||||
|   { | ||||
|     path: '/system/notify-message', | ||||
|     component: () => import('#/views/system/notify/my/index.vue'), | ||||
|     name: 'MyNotifyMessage', | ||||
|     meta: { | ||||
|       title: '我的站内信', | ||||
|       icon: 'ant-design:message-filled', | ||||
|       hideInMenu: true, | ||||
|     }, | ||||
|   }, | ||||
| ]; | ||||
| 
 | ||||
| export default routes; | ||||
|  | @ -0,0 +1,30 @@ | |||
| import type { Router } from 'vue-router'; | ||||
| 
 | ||||
| declare global { | ||||
|   interface Window { | ||||
|     _hmt: any[]; | ||||
|   } | ||||
| } | ||||
| 
 | ||||
| const HM_ID = import.meta.env.VITE_APP_BAIDU_CODE; | ||||
| 
 | ||||
| /** | ||||
|  * 设置百度统计 | ||||
|  * @param router | ||||
|  */ | ||||
| function setupBaiduTongJi(router: Router) { | ||||
|   // 如果没有配置百度统计的 ID,则不进行设置
 | ||||
|   if (!HM_ID) { | ||||
|     return; | ||||
|   } | ||||
| 
 | ||||
|   // _hmt:用于 router push
 | ||||
|   window._hmt = window._hmt || []; | ||||
| 
 | ||||
|   router.afterEach((to) => { | ||||
|     // 添加到 _hmt 中
 | ||||
|     window._hmt.push(['_trackPageview', to.fullPath]); | ||||
|   }); | ||||
| } | ||||
| 
 | ||||
| export { setupBaiduTongJi }; | ||||
		Loading…
	
		Reference in New Issue
	
	 xingyu4j
						xingyu4j