aa
This commit is contained in:
@@ -39,3 +39,36 @@ function doSavePageLog(data) {
|
||||
console.log(error);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 记录用户行为日志
|
||||
*/
|
||||
function saveBehaviorLog(event,dataMap) {
|
||||
var page = document.getElementsByTagName("title")[0].innerHTML;
|
||||
var device = plus.device.uuid;
|
||||
var model = plus.device.model;
|
||||
plus.geolocation.getCurrentPosition(function(p){
|
||||
baidu_city = p.address.city;
|
||||
baidu_lng = p.coords.longitude;
|
||||
baidu_lat = p.coords.latitude;
|
||||
baidu_address = p.address.street;
|
||||
doSaveBehaviorLog({page:page, lng:baidu_lng, lat:baidu_lat, province:baidu_province, city:baidu_city, region:baidu_region, address:baidu_address, device:device, model:model,event:event,businessData:dataMap});
|
||||
}, function(e){
|
||||
doSaveBehaviorLog({page:page, device:device, model:model,event:event,businessData:dataMap});
|
||||
},
|
||||
{
|
||||
provider:'baidu',
|
||||
enableHighAccuracy:true,
|
||||
coordsType:'bd09ll'
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
function doSaveBehaviorLog(data) {
|
||||
axios.post("/rest/log/saveBehaviorLog", data).then(function (response) {
|
||||
|
||||
}).catch(function (error) {
|
||||
console.log(error);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user