@youngbeen/angle-ctrl
Advanced tools
+13
-20
@@ -11,2 +11,3 @@ 'use strict'; | ||
| require('@youngbeen/ums-tracking'); | ||
| var logs = []; // 日志信息 | ||
@@ -47,24 +48,16 @@ var tagRandoms = Math.floor(Math.random() * 10e13); // 用于标识某访问的唯一标识符组成部分的随机数 | ||
| var tag = tagTime + '-' + tagRandoms; // 组成该次访问的唯一标识符,用于日志筛选匹配对应使用 | ||
| var now = new Date(); | ||
| now = now.getTime(); | ||
| now = _angleUtil.dateUtil.getDateTime(now); | ||
| var params = { | ||
| url: window.location.href || '', | ||
| tag: tag, | ||
| ua: window.navigator.userAgent || '', | ||
| clientTime: now, // 格式形如 2017-01-01 10:00:00 | ||
| historyLogs: logs | ||
| // window.tracking('UMS_FELOG_ERRORLOG', params) | ||
| };var content = { | ||
| id: 'UMS_FELOG_ERRORLOG', | ||
| params: params | ||
| // TODO 自有后台接收日志的地址后续需要调整 | ||
| };var url = 'https://someurl?type=UMS_FELOG&content=LOGSTART>>' + encodeURIComponent(JSON.stringify(content)) + '<<LOGEND'; | ||
| var oImage = new Image(); | ||
| oImage.src = url; | ||
| oImage = null; | ||
| // 使用tracking方法发送日志 | ||
| if (window.tracking) { | ||
| window.tracking('UMS_FELOG_ERRORLOG', { | ||
| tag: tag, | ||
| historyLogs: logs | ||
| }, 'fe_errorlog'); | ||
| } | ||
| // 使用图片发送日志 | ||
| // let url = `https://someurl?type=UMS_FELOG&content=LOGSTART>>${encodeURIComponent(JSON.stringify(content))}<<LOGEND` | ||
| // let oImage = new Image() | ||
| // oImage.src = url | ||
| // oImage = null | ||
| } | ||
| } | ||
| }; |
+3
-2
| { | ||
| "name": "@youngbeen/angle-ctrl", | ||
| "version": "1.0.8", | ||
| "version": "1.0.9", | ||
| "description": "The controllers used in angle-FE team", | ||
| "main": "index.js", | ||
| "dependencies": { | ||
| "@youngbeen/angle-util": "^1.0.1" | ||
| "@youngbeen/angle-util": "^1.0.1", | ||
| "@youngbeen/ums-tracking": "0.0.2" | ||
| }, | ||
@@ -9,0 +10,0 @@ "devDependencies": { |
+12
-21
| // this controller is about to provide functions for log controll | ||
| import { dateUtil } from '@youngbeen/angle-util' | ||
| require('@youngbeen/ums-tracking') | ||
| let logs = [] // 日志信息 | ||
@@ -33,26 +34,16 @@ const tagRandoms = Math.floor(Math.random() * 10e13) // 用于标识某访问的唯一标识符组成部分的随机数 | ||
| const tag = `${tagTime}-${tagRandoms}` // 组成该次访问的唯一标识符,用于日志筛选匹配对应使用 | ||
| let now = new Date() | ||
| now = now.getTime() | ||
| now = dateUtil.getDateTime(now) | ||
| let params = { | ||
| url: window.location.href || '', | ||
| tag, | ||
| ua: window.navigator.userAgent || '', | ||
| clientTime: now, // 格式形如 2017-01-01 10:00:00 | ||
| historyLogs: logs | ||
| // 使用tracking方法发送日志 | ||
| if (window.tracking) { | ||
| window.tracking('UMS_FELOG_ERRORLOG', { | ||
| tag, | ||
| historyLogs: logs | ||
| }, 'fe_errorlog') | ||
| } | ||
| // window.tracking('UMS_FELOG_ERRORLOG', params) | ||
| let content = { | ||
| id: 'UMS_FELOG_ERRORLOG', | ||
| params | ||
| } | ||
| // TODO 自有后台接收日志的地址后续需要调整 | ||
| let url = `https://someurl?type=UMS_FELOG&content=LOGSTART>>${encodeURIComponent(JSON.stringify(content))}<<LOGEND` | ||
| let oImage = new Image() | ||
| oImage.src = url | ||
| oImage = null | ||
| // 使用图片发送日志 | ||
| // let url = `https://someurl?type=UMS_FELOG&content=LOGSTART>>${encodeURIComponent(JSON.stringify(content))}<<LOGEND` | ||
| // let oImage = new Image() | ||
| // oImage.src = url | ||
| // oImage = null | ||
| } | ||
| } | ||
| } |
27633
-1.59%2
100%648
-1.82%+ Added