fe-drone-ci/src/errorLog.js

15 lines
310 B
JavaScript
Raw Normal View History

2017-08-21 07:55:46 +00:00
import Vue from 'vue'
import errLog from '@/store/errLog'
// 生产环境错误日志
if (process.env.NODE_ENV === 'production') {
Vue.config.errorHandler = function(err, vm) {
2017-08-22 07:43:34 +00:00
console.log(err, window.location.href)
2017-08-21 07:55:46 +00:00
errLog.pushLog({
err,
url: window.location.href,
vm
})
2017-08-22 07:43:34 +00:00
}
2017-08-21 07:55:46 +00:00
}