diff --git a/src/utils/request.js b/src/utils/request.js index e4ed8f8..70279bf 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -54,6 +54,8 @@ instance.interceptors.request.use( } if (store.getters['user/appId']) { config.headers['x-app-id'] = store.getters['user/appId'] + } else { + config.headers['x-app-id'] = '69665538a49b8ae3be50fe5d' } if (config.method === 'get' && config.params) { config.params = Vue.prototype.$baseLodash.pickBy(config.params, Vue.prototype.$baseLodash.identity) diff --git a/src/views/index/components/TrackingCharts.vue b/src/views/index/components/TrackingCharts.vue index a0a1de0..8152c9f 100644 --- a/src/views/index/components/TrackingCharts.vue +++ b/src/views/index/components/TrackingCharts.vue @@ -63,6 +63,9 @@ 查询 重置 + 去掉熟人 + 只显示有用户请求 + 只显示无用户请求 @@ -183,6 +186,8 @@ }, data() { return { + excludeAcquaintance: false, + onlyUserId: null, // null: all, true: only with user, false: only without user eventNameMap, eventTypeMap, appMap, @@ -281,6 +286,13 @@ pageSize: 10000, // 获取足够多的数据进行前端统计,或者应该依赖后端聚合接口 } + if (this.excludeAcquaintance) { + params.excludeAcquaintance = true + } + if (this.onlyUserId !== null) { + params.onlyUserId = this.onlyUserId + } + const { data } = await getTrackingLogsList(params) this.list = data.list || [] @@ -322,6 +334,18 @@ this.pageSize = val this.currentPage = 1 }, + toggleExcludeAcquaintance() { + this.excludeAcquaintance = !this.excludeAcquaintance + this.fetchData() + }, + toggleOnlyUserId(value) { + if (this.onlyUserId === value) { + this.onlyUserId = null // Toggle off if already selected + } else { + this.onlyUserId = value + } + this.fetchData() + }, handleCurrentChange(val) { this.currentPage = val },