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

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

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