Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mayi-mp-shop
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
程默
mayi-mp-shop
Commits
c4b14292
Commit
c4b14292
authored
Jul 08, 2020
by
程默
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix 12
parent
27594e00
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
54 deletions
+15
-54
package.json
+1
-0
src/App.vue
+14
-54
No files found.
package.json
View file @
c4b14292
...
@@ -24,6 +24,7 @@
...
@@ -24,6 +24,7 @@
},
},
"dependencies"
:
{
"dependencies"
:
{
"
flyio
"
:
"^0.6.14"
,
"
flyio
"
:
"^0.6.14"
,
"
mayi-analytics
"
:
"^1.1.11"
,
"
mpvue
"
:
"^2.0.0"
,
"
mpvue
"
:
"^2.0.0"
,
"
vuex
"
:
"^3.0.1"
"
vuex
"
:
"^3.0.1"
},
},
...
...
src/App.vue
View file @
c4b14292
<
script
>
<
script
>
// let mpAnalytics=require('../node_modules/mayi-analytics/dist/');
let
mpAnalytics
=
require
(
"../node_modules/mayi-analytics/dist/mayi.mpAnalytics.js"
)
let
systemInfo
;
.
default
;
try
{
mpAnalytics
.
init
({
systemInfo
=
wx
.
getSystemInfoSync
();
url
:
"https://analytics.mayi888.cn/ma.gif"
,
}
catch
(
e
)
{
app
:
"mayi-mp-shop"
,
//项目名称
// Do something when catch error
wx
}
});
export
default
{
export
default
{
created
()
{
created
()
{
// NODE_ENV
// NODE_ENV
...
@@ -36,54 +37,13 @@ export default {
...
@@ -36,54 +37,13 @@ export default {
logs
.
unshift
(
Date
.
now
());
logs
.
unshift
(
Date
.
now
());
mpvue
.
setStorageSync
(
"logs"
,
logs
);
mpvue
.
setStorageSync
(
"logs"
,
logs
);
}
}
//----------
// const originRequest = wx.request;
// Object.defineProperty(wx, "request", {
// configurable: true,
// enumerable: true,
// writable: true,
// value: function() {
// const config = arguments[0] || {};
// const url = config.url;
// if (url.indexOf(process.env.BASE_URL) > -1) {
// // 直接发送请求,不上报
// return originRequest.apply(this, arguments);
// }
// console.log("上报ajax数据啦!");
// // wx.request({
// // url: "https://analytics.mayi888.cn/ma.gif",
// // data: config.data
// // });
// return originRequest.apply(this, arguments);
// }
// });
},
},
onError
(
err
)
{
onError
(
data
)
{
console
.
log
(
err
,
"js异常捕获"
);
console
.
log
(
data
,
"js异常捕获"
);
wx
.
request
({
mpAnalytics
.
recordError
({
url
:
"https://analytics.mayi888.cn/ma.gif"
,
data
,
data
:
{
extendsInfo
:
{
v
:
Date
.
now
(),
mixid
:
this
.
$store
.
state
.
mixid
||
null
e
:
"mp_error"
,
category
:
"js_error"
,
logType
:
"Error"
,
extendsInfo
:
{
mixid
:
this
.
$store
.
state
.
mixid
,
openid
:
wx
.
getStorageSync
(
"openid"
)
||
null
},
logInfo
:
{
err
},
deviceInfo
:
{
...
systemInfo
}
},
method
:
"GET"
,
success
:
function
(
res
)
{
console
.
log
(
"上报成功"
,
res
);
},
fail
:
function
(
res
)
{
console
.
log
(
"上报失败"
,
res
);
}
}
});
});
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment