浏览代码

🚧 修复从详情页返回显示的报错问题

快乐的梦鱼 1 月之前
父节点
当前提交
8aa2d35123

+ 1 - 1
src/common/request/core/RequestApiConfig.ts

@@ -42,7 +42,7 @@ const defaultConfig = {
   BaseUrl: isDev ? ApiCofig.serverDev : ApiCofig.serverProd,
   DataDateFormat: 'YYYY-MM-DD HH:mm:ss',
   DefaultHeader: {},
-  EnableApiRequestLog: true,
+  EnableApiRequestLog: false,
   EnableApiDataLog: false,
 } as ApiConfigInterface;
 

+ 0 - 2
src/composeable/SimpleDataLoader.ts

@@ -79,8 +79,6 @@ export async function useSSrSimpleDataLoader<T, P = any>(
     loadStatus.value = 'loading';
     try {
       const res = await loader(params ?? lastParams) as T;
-      console.log('res', res);
-      
       content.value = res as any;
       if (Array.isArray(res) && emptyIfArrayEmpty && (res as any[]).length === 0)
         loadStatus.value = 'nomore';

+ 3 - 1
src/pages/details/TabDetailView.vue

@@ -169,7 +169,9 @@ const loader = await useSSrSimpleDataLoader('details' + route.query.id, async ()
   return (await props.load(Number(route.query.id))).toJSON();
 }, false);
 
-watch(() => route.query.id, () => {
+watch(() => route.query.id, (v) => {
+  if (!v)
+    return;
   loader.loadData(undefined, true);
 })