zhengyiming
2 天以前 a69bf92c8907eb1fed227afb156ff0e1c5821c24
fix: bug
2个文件已修改
13 ■■■■ 已修改文件
apps/bMiniApp/src/hooks/router.ts 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packages/utils/LoggerRecord/index.ts 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
apps/bMiniApp/src/hooks/router.ts
@@ -1,6 +1,7 @@
import Taro from '@tarojs/taro';
import { TabBarPageRouter } from '@/constants';
import { useSystemStore } from '@/stores/modules/system';
import { httpLoggerRecord } from '@12333/utils';
export function useSwitchTab() {
  const systemStore = useSystemStore();
@@ -10,6 +11,10 @@
    console.log('index: ', index);
    systemStore.setTabIndex(index);
    Taro.switchTab(option);
    httpLoggerRecord.info({
      message: `[switchTab]`,
      args: [option, { index, TabBarPageRouter }],
    });
  };
  return switchTab;
}
packages/utils/LoggerRecord/index.ts
@@ -55,7 +55,7 @@
  }
}
export const httpLoggerRecord = new HttpLoggerRecord({
const Options: LoggerRecordOptions = {
  moduleName: getUtilsConfig().appName,
  enableStorage: true,
  loggerStorageAdapter() {
@@ -71,4 +71,8 @@
  getPageUrl() {
    return Taro.getCurrentInstance()?.router?.path ?? '';
  },
});
};
export const defaultLoggerRecord = new LoggerRecord(Options);
export const httpLoggerRecord = new HttpLoggerRecord(Options);