chore(project): 添加项目配置文件和忽略规则
- 添加 Babel 配置文件支持 ES6+ 语法转换 - 添加 ESLint 忽略规则和配置文件 - 添加 Git 忽略规则文件 - 添加 Travis CI 配置文件 - 添加 1.4.2 版本变更日志文件 - 添加 Helm 图表辅助模板文件 - 添加 Helm 忽略规则文件
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
import Global from '@common/Global';
|
||||
import { toQueryString } from '@utils';
|
||||
|
||||
const BASE_URL = 'http://gm.mmstat.com/fsp.1.1';
|
||||
|
||||
const track = (options) => {
|
||||
const trackable = Global.get('trackable');
|
||||
const version = Global.get('version');
|
||||
|
||||
if (!trackable) {
|
||||
return;
|
||||
}
|
||||
|
||||
const { location, navigator } = window;
|
||||
const image = new Image();
|
||||
const params = toQueryString({
|
||||
pid: 'ggeditor',
|
||||
code: '11',
|
||||
msg: 'syslog',
|
||||
page: `${location.protocol}//${location.host}${location.pathname}`,
|
||||
hash: location.hash,
|
||||
ua: navigator.userAgent,
|
||||
rel: version,
|
||||
...options,
|
||||
});
|
||||
|
||||
image.src = `${BASE_URL}?${params}`;
|
||||
};
|
||||
|
||||
export default (options) => {
|
||||
setTimeout(() => {
|
||||
track(options);
|
||||
}, 1000);
|
||||
};
|
||||
Reference in New Issue
Block a user