guoziyun 9 ماه پیش
والد
کامیت
ece25fc0d1

+ 11 - 11
oms/dist/src/app.js

@@ -53,17 +53,17 @@ app.use((req, res, next) => {
     next();
 });
 // --- 在这里添加全局禁用缓存的中间件 ---
-app.use("/api", (req, res, next) => {
-    // 为所有 API 路由显式禁用浏览器缓存
-    res.set({
-        "Cache-Control": "no-cache, no-store, must-revalidate",
-        Pragma: "no-cache",
-        Expires: "0",
-        ETag: null, // 移除ETag以强制浏览器重新验证
-        "Last-Modified": null, // 移除Last-Modified以强制浏览器重新验证
-    });
-    next();
-});
+// app.use("/api", (req: Request, res: Response, next: NextFunction) => {
+//   // 为所有 API 路由显式禁用浏览器缓存
+//   res.set({
+//     "Cache-Control": "no-cache, no-store, must-revalidate",
+//     Pragma: "no-cache",
+//     Expires: "0",
+//     ETag: null, // 移除ETag以强制浏览器重新验证
+//     "Last-Modified": null, // 移除Last-Modified以强制浏览器重新验证
+//   });
+//   next();
+// });
 // ------------------------------------
 // API routes
 app.use("/api", apiRoutes_1.default);

+ 5 - 0
oms/dist/src/services/messageRecordService.js

@@ -156,6 +156,7 @@ class MessageRecordService {
                     },
                 },
             ]);
+            console.log(`overall: ${result[0]}`);
             return result[0];
         }
         catch (error) {
@@ -255,6 +256,7 @@ class MessageRecordService {
                     $sort: { deliveredRate: -1 },
                 },
             ]);
+            console.log(`by-activity: ${results}`);
             return results;
         }
         catch (error) {
@@ -354,6 +356,7 @@ class MessageRecordService {
                     $sort: { deliveredRate: -1 },
                 },
             ]);
+            console.log(`by-strategy: ${results}`);
             return results;
         }
         catch (error) {
@@ -453,6 +456,7 @@ class MessageRecordService {
                     $sort: { deliveredRate: -1 },
                 },
             ]);
+            console.log(`by-template: ${results}`);
             return results;
         }
         catch (error) {
@@ -554,6 +558,7 @@ class MessageRecordService {
                     $sort: { date: 1 },
                 },
             ]);
+            console.log(`daily-trends: ${results}`);
             return results;
         }
         catch (error) {

+ 1 - 1
oms/public/app/index.html

@@ -9,5 +9,5 @@
   <style>body,html{width:100%;height:100%}*,:after,:before{box-sizing:border-box}html{font-family:sans-serif;line-height:1.15;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;-ms-overflow-style:scrollbar;-webkit-tap-highlight-color:transparent}@-ms-viewport{width:device-width}body{margin:0;color:#000000d9;font-size:14px;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-variant:tabular-nums;line-height:1.5715;background-color:#fff;font-feature-settings:"tnum"}html{--antd-wave-shadow-color:#1890ff;--scroll-bar:0}</style><link rel="stylesheet" href="styles-LXBSU6DF.css" media="print" onload="this.media='all'"><noscript><link rel="stylesheet" href="styles-LXBSU6DF.css"></noscript></head>
   <body>
     <app-root></app-root>
-  <script src="polyfills-B6TNHZQ6.js" type="module"></script><script src="main-GFS67RGV.js" type="module"></script></body>
+  <script src="polyfills-B6TNHZQ6.js" type="module"></script><script src="main-PDDYGVJ6.js" type="module"></script></body>
 </html>

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 0
oms/public/app/main-PDDYGVJ6.js


+ 11 - 11
oms/src/app.ts

@@ -54,17 +54,17 @@ app.use((req: Request, res: Response, next: NextFunction) => {
 });
 
 // --- 在这里添加全局禁用缓存的中间件 ---
-app.use("/api", (req: Request, res: Response, next: NextFunction) => {
-  // 为所有 API 路由显式禁用浏览器缓存
-  res.set({
-    "Cache-Control": "no-cache, no-store, must-revalidate",
-    Pragma: "no-cache",
-    Expires: "0",
-    ETag: null, // 移除ETag以强制浏览器重新验证
-    "Last-Modified": null, // 移除Last-Modified以强制浏览器重新验证
-  });
-  next();
-});
+// app.use("/api", (req: Request, res: Response, next: NextFunction) => {
+//   // 为所有 API 路由显式禁用浏览器缓存
+//   res.set({
+//     "Cache-Control": "no-cache, no-store, must-revalidate",
+//     Pragma: "no-cache",
+//     Expires: "0",
+//     ETag: null, // 移除ETag以强制浏览器重新验证
+//     "Last-Modified": null, // 移除Last-Modified以强制浏览器重新验证
+//   });
+//   next();
+// });
 // ------------------------------------
 
 // API routes

+ 6 - 0
oms/src/services/messageRecordService.ts

@@ -171,6 +171,8 @@ export class MessageRecordService {
           },
         },
       ]);
+
+      console.log(`overall: ${result[0]}`);
       return result[0];
     } catch (error) {
       console.error("Error fetching overall statistics:", error);
@@ -271,6 +273,7 @@ export class MessageRecordService {
         },
       ]);
 
+      console.log(`by-activity: ${results}`);
       return results;
     } catch (error) {
       console.error("Error fetching statistics by activity:", error);
@@ -370,6 +373,7 @@ export class MessageRecordService {
           $sort: { deliveredRate: -1 },
         },
       ]);
+      console.log(`by-strategy: ${results}`);
       return results;
     } catch (error) {
       console.error("Error fetching statistics by strategy:", error);
@@ -469,6 +473,7 @@ export class MessageRecordService {
           $sort: { deliveredRate: -1 },
         },
       ]);
+      console.log(`by-template: ${results}`);
       return results;
     } catch (error) {
       console.error("Error fetching statistics by template:", error);
@@ -570,6 +575,7 @@ export class MessageRecordService {
           $sort: { date: 1 },
         },
       ]);
+      console.log(`daily-trends: ${results}`);
       return results;
     } catch (error) {
       console.error("Error fetching daily sent trends:", error);

+ 6 - 6
omsapp/src/app/pages/message-dashboard.component.html

@@ -125,8 +125,8 @@
               <th>总发送量</th>
               <th>成功数</th>
               <th>送达数</th>
-              <th>打开数</th>
               <th>展示数</th>
+              <th>打开数</th>
               <th>失败数</th>
               <th>送达率</th>
               <th>展示率</th>
@@ -148,8 +148,8 @@
               <td>{{ item.totalRecords || 0 }}</td>
               <td>{{ item.sent || 0 }}</td>
               <td>{{ item.delivered || 0 }}</td>
-              <td>{{ item.opened || 0 }}</td>
               <td class="display-count-column">{{ item.displayCount || 0 }}</td>
+              <td>{{ item.opened || 0 }}</td>
               <td>{{ item.failed || 0 }}</td>
               <td>
                 <div class="progress-container">
@@ -228,8 +228,8 @@
               <th>总发送量</th>
               <th>成功数</th>
               <th>送达数</th>
-              <th>打开数</th>
               <th>展示数</th>
+              <th>打开数</th>
               <th>失败数</th>
               <th>送达率</th>
               <th>展示率</th>
@@ -251,8 +251,8 @@
               <td>{{ item.totalRecords || 0 }}</td>
               <td>{{ item.sent || 0 }}</td>
               <td>{{ item.delivered || 0 }}</td>
-              <td>{{ item.opened || 0 }}</td>
               <td class="display-count-column">{{ item.displayCount || 0 }}</td>
+              <td>{{ item.opened || 0 }}</td>
               <td>{{ item.failed || 0 }}</td>
               <td>
                 <div class="progress-container">
@@ -305,9 +305,9 @@
                     nzSize="small"
                     nzStatus="exception"
                   ></nz-progress>
-                  <!-- <span class="percentage-text">{{
+                  <span class="percentage-text">{{
                     formatPercentage(item.tokenInvalidationRate || 0)
-                  }}</span> -->
+                  }}</span>
                 </div>
               </td>
             </tr>

برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است