浏览代码

fix ua修改

erekook 1 年之前
父节点
当前提交
59195476c0
共有 1 个文件被更改,包括 7 次插入2 次删除
  1. 7 2
      utils/util.js

+ 7 - 2
utils/util.js

@@ -133,7 +133,7 @@ export const SendEvent = (eventName, eventParam, self) => {
         const app = self || getApp()
         let eParam = {...eventParam}
 
-        const deviceInfo = wx.getDeviceInfo()
+        const { brand, model, system, platform } = wx.getDeviceInfo()
 
         let opt = {
             app_id: apple.appKey,
@@ -144,7 +144,12 @@ export const SendEvent = (eventName, eventParam, self) => {
             event_value: JSON.stringify(eParam),
             report_time: Date.now(),
             trace_id: uuid(),
-            user_agent: JSON.stringify(deviceInfo)
+            user_agent: JSON.stringify({
+                brand,
+                model,
+                system,
+                platform,
+            })
         }
 
         opt.union_id = app.globalData.unionId || ''