We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b49d484 commit 0f5b46dCopy full SHA for 0f5b46d
src/components/MainPage/analytics.vue
@@ -447,8 +447,18 @@
447
userActionObject = data.userAction;
448
449
for(let i in userActionObject){
450
- if(JSON.stringify(userActionObject[i].location) === '[]'){
451
- userActionObject[i].location = '地球';
+ // 保护用户隐私,马赛克掉ip最后一组数字
+ let array = i.split('.'),
452
+ currentIp = array[0] + '.' + array[1] + '.' + array[2] + '.***',
453
+ item = userActionObject[i];
454
+
455
+ // 为用户IP打码
456
+ userActionObject[currentIp] = item;
457
+ delete userActionObject[i];
458
459
+ // 因为对象当前本来的属性名已经被删掉了,所以得修改新的属性名对应的属性值
460
+ if(JSON.stringify(userActionObject[currentIp].location) === '[]'){
461
+ userActionObject[currentIp].location = '地球';
462
}
463
464
0 commit comments