Commit 43ee4826 authored by jiangjiantao's avatar jiangjiantao

增加错误监控

parent 86bcb384
import monitor from '/utils/alipayLogger'; import monitor from '/utils/alipayLogger';
var fundebug = require('./utils/fundebug.0.2.0.min.js');
fundebug.init(
{
apikey: 'c0c5937571f82aecab3f7578bea5d8163455cd2407863f94829bee12324f57b4'
})
App(monitor.hookApp({ App(monitor.hookApp({
globalData: { globalData: {
version: "1.0.1.20200311", version: "1.0.1.20200311",
TEST_URL: "https://cashier.test.miyahub.net/", TEST_URL: "https://cashier.test.miyahub.net/",
RELEASE_URL: "https://cashier.miyahub.com/", RELEASE_URL: "https://cashier.miyahub.com/",
LOG_URL: "https://log.test.miyahub.net/log",
appId: "2021001107617164", appId: "2021001107617164",
frontScreenAppId: "2021001107603212", frontScreenAppId: "2021001107603212",
userName:""
}, },
onLaunch(options) { onLaunch(options) {
monitor.init({ monitor.init({
pid: "qzhr85jigetfamuqniwz4q==", pid: "qzhr85jigetfamuqniwz4q==",
options: options, options: options,
...@@ -42,10 +35,33 @@ App(monitor.hookApp({ ...@@ -42,10 +35,33 @@ App(monitor.hookApp({
// options.query == {number:1} // options.query == {number:1}
}, },
onError(err) //错误上报
{ onError(err) {
fundebug.onError(err); try {
}, var commonRequest = {
appId: this.globalData.appId,
account: this.globalData.userName,
version: this.globalData.version,
extra_data: err
};
my.request({
url: this.globalData.LOG_URL,
method: 'POST',
dataType: 'json',
timeout: 30000,
data: commonRequest,
success: (res) => {
console.log("upload log success");
},
fail: (res) => {
console.log("upload log fail");
}
});
} catch (e) {
console.log("upload log exp",e);
}
}
})); }));
...@@ -305,6 +305,7 @@ Page({ ...@@ -305,6 +305,7 @@ Page({
var sn = loginOptions.sn; var sn = loginOptions.sn;
var account = loginOptions.account; var account = loginOptions.account;
var version = loginOptions.containerVersion; var version = loginOptions.containerVersion;
getApp().globalData.userName = account.userName
context.setData({ context.setData({
isFrontScreenLoginOK: true, isFrontScreenLoginOK: true,
storeName: account.storeName, storeName: account.storeName,
...@@ -506,6 +507,7 @@ Page({ ...@@ -506,6 +507,7 @@ Page({
/**首页相关 */ /**首页相关 */
/**立即收款 */ /**立即收款 */
onHomeCashierImmediatelyClicked: throttle(2000, function () { onHomeCashierImmediatelyClicked: throttle(2000, function () {
if (this.showLoading == true) { if (this.showLoading == true) {
return return
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment