Commit 17f3c4b9 by 李伟康

fix(reportTrackFunMixin): 防止业务参数为空时上报错误

修复了在 track_businessParam_key 对应的数据不存在时,
直接访问导致的潜在错误。现在会先检查数据是否存在,
如果不存在则使用空对象作为默认值。
1 parent 7170793d
...@@ -118,10 +118,12 @@ export default { ...@@ -118,10 +118,12 @@ export default {
this.setBrowseTrackData() this.setBrowseTrackData()
}, 10e3) }, 10e3)
} }
let trackParams = {}
if(this.track_businessParam_key) trackParams = this[this.track_businessParam_key] || {}
this.setReportTrackData( this.setReportTrackData(
2, 2,
this.track_event_code, this.track_event_code,
this[this.track_businessParam_key], trackParams,
this.track_batchId this.track_batchId
) )
} catch (error) { } catch (error) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!