You've already forked template-MP
新增 全局JS错误监控模块,集成WebHook上报功能
This commit is contained in:
9
main.js
9
main.js
@@ -2,6 +2,7 @@ import App from './App'
|
||||
import uviewPlus from '/uview-plus'
|
||||
import globalMixin from './mixins/global'
|
||||
import store from './store'
|
||||
import tool from './common/utils/tool'
|
||||
import { createSSRApp } from 'vue'
|
||||
import './uni.promisify.adaptor'
|
||||
|
||||
@@ -17,5 +18,13 @@ export function createApp() {
|
||||
app.use(uviewPlus)
|
||||
app.use(globalMixin)
|
||||
app.use(store)
|
||||
|
||||
// 初始化全局错误监控
|
||||
tool.initErrorMonitor({
|
||||
enableGlobalError: true,
|
||||
enablePromiseError: true,
|
||||
enableConsoleError: false, // 可选开启console错误监控
|
||||
})
|
||||
|
||||
return { app }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user