Forráskód Böngészése

📦 发贴图埋点统计接口

快乐的梦鱼 1 hónapja
szülő
commit
3bec58fcec

+ 4 - 3
src/api/light/OfficialApi.ts

@@ -502,12 +502,13 @@ export class OfficialApi extends AppServerRequestModule<DataModel> {
   }
 
   /**
-   * 埋点统计
+   * 贴图点击埋点统计
    */
-  async traceLogApi(action: string, data: KeyValue) {
-    return await this.post('/village/ai/package', '埋点统计', {
+  async traceOfficalLogApi(action: string, data: KeyValue) {
+    return await this.post('/village/collect/officialClick', '贴图点击埋点统计', {
       action,
       data,
+      ...data,
     });
   }
 }

+ 1 - 1
src/components/form/Uploader.vue

@@ -539,7 +539,7 @@ async function startUploadItem(item: UploaderItem) {
         item.message = ('' + formatError(error)).replace('Error: ', '');
         updateListItem(item);
         reject(error);
-        LogUtils.printLog(TAG, 'error', `上传文件 ${item.filePath} 失败,错误信息:${error}`);
+        LogUtils.printLog(TAG, 'error', `上传文件 ${item.filePath} 失败,错误信息:${formatError(error)}`);
       },
       onFinish(result, message) {
         updateProgressDebounce.cancel();

+ 3 - 2
src/pages/home/chat/dependent/post/publish.vue

@@ -236,11 +236,12 @@ async function publish() {
     toast('请上传图片');
     return;
   }
+  const prePublishId = (await prePublish()).id;
   const data = {
     title: title.value,
     content: content.value,
     images: images.value.map((image) => image.localUrl),
-    recommendPath: makeOfficialPublishLinkPathAndParams('/pages/index', (await prePublish()).id),
+    recommendPath: makeOfficialPublishLinkPathAndParams('/pages/index', prePublishId),
     recommendTitle: '亮乡源',
     tags: [
       '亮乡源',
@@ -251,7 +252,7 @@ async function publish() {
   (uni as any).shareToOfficialAccount({
     ...data,
     success: (postObj: { postUrl: string }) => {
-      onPublishSuccess(postObj);
+      onPublishSuccess(postObj, prePublishId);
       uni.removeStorageSync('postDraft');
       toast('发布成功, 文章可能需要等待微信审核,稍后才能展示');
       setTimeout(() => {

+ 3 - 6
src/pages/index.vue

@@ -105,12 +105,9 @@ const { querys } = useLoadQuerys({
       case 'offical':
         //处理从推广文章返回跳转小程序点击量情况
         if (sp.length >= 2) {
-          OfficialApi.traceLogApi('click', {
-            action: 'offical_card_clickback',
-            data: {
-              user_id: Number(sp[1]),
-              wechat_content_id: Number(sp[2]),
-            },
+          OfficialApi.traceOfficalLogApi('offical_card_clickback', {
+            user_id: Number(sp[1]),
+            wechat_content_id: Number(sp[2]),
           });
         }
         break;