提交 5484772d 编写于 作者: M mehaotian

fix(stat): 修改上报地址,修复开发模式下 report 报错的 bug

上级 4498f532
import { version } from '../package.json';
const STAT_VERSION = version;
const STAT_URL = 'https://tongji.dcloud.net.cn/uni/stat';
const STAT_H5_URL = 'https://tongji.dcloud.net.cn/uni/stat.gif';
const STAT_URL = 'https://uniapp.dcloud.io/uni/stat';
const STAT_H5_URL = 'https://uniapp.dcloud.io/uni/stat.gif';
const PAGE_PVER_TIME = 1800;
const APP_PVER_TIME = 300;
const OPERATING_TIME = 10;
......@@ -647,8 +647,8 @@ class Util {
// },
data: optionsData,
success: () => {
// if (process.env.NODE_ENV === 'development') {
// console.log('stat request success');
// if (process.env.NODE_ENV === 'development') {
// console.log('stat request success');
// }
},
fail: (e) => {
......@@ -863,10 +863,14 @@ const lifecycle = {
function main() {
const Vue = require('vue');
(Vue.default || Vue).mixin(lifecycle);
uni.report = function(type, options) {
stat.sendEvent(type, options);
};
if (process.env.NODE_ENV === 'development') {
uni.report = function(type, options) {};
}else{
(Vue.default || Vue).mixin(lifecycle);
uni.report = function(type, options) {
stat.sendEvent(type, options);
};
}
}
main();
......@@ -2,8 +2,8 @@ import {
version
} from '../package.json'
export const STAT_VERSION = version
export const STAT_URL = 'https://tongji.dcloud.net.cn/uni/stat'
export const STAT_H5_URL = 'https://tongji.dcloud.net.cn/uni/stat.gif'
export const STAT_URL = 'https://uniapp.dcloud.io/uni/stat'
export const STAT_H5_URL = 'https://uniapp.dcloud.io/uni/stat.gif'
export const STAT_KEY = 'qkTHEIegZGcL5iy3'
export const PAGE_PVER_TIME = 1800
export const APP_PVER_TIME = 300
......
......@@ -36,10 +36,14 @@ const lifecycle = {
function main() {
const Vue = require('vue');
(Vue.default || Vue).mixin(lifecycle);
uni.report = function(type, options) {
stat.sendEvent(type, options);
};
if (process.env.NODE_ENV === 'development') {
uni.report = function(type, options) {};
}else{
(Vue.default || Vue).mixin(lifecycle);
uni.report = function(type, options) {
stat.sendEvent(type, options);
};
}
}
main();
......@@ -382,8 +382,8 @@ class Util {
// },
data: optionsData,
success: () => {
// if (process.env.NODE_ENV === 'development') {
// console.log('stat request success');
// if (process.env.NODE_ENV === 'development') {
// console.log('stat request success');
// }
},
fail: (e) => {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册