refactor(router): 移除调试日志并添加日志开关控制

添加 FG_LOG_ENABLE 开关控制调试日志输出
移除 index 页面中的无用 console.log
This commit is contained in:
feige996
2025-08-29 15:15:14 +08:00
parent 87ab4a5d93
commit bb3e458086
3 changed files with 13 additions and 12 deletions

View File

@@ -1,6 +1,7 @@
import type { CustomTabBarItem, CustomTabBarItemBadge } from './config'
import { reactive } from 'vue'
import { FG_LOG_ENABLE } from '@/router/interceptor'
import { tabbarList as _tabbarList, customTabbarEnable } from './config'
// TODO 1/2: 中间的鼓包tabbarItem的开关
@@ -44,7 +45,7 @@ const tabbarStore = reactive({
},
setAutoCurIdx(path: string) {
const index = tabbarList.findIndex(item => item.pagePath === path)
console.log('index:', index, path)
FG_LOG_ENABLE && console.log('index:', index, path)
// console.log('tabbarList:', tabbarList)
if (index === -1) {
const pagesPathList = getCurrentPages().map(item => item.route.startsWith('/') ? item.route : `/${item.route}`)