2017-08-21 07:55:46 +00:00
|
|
|
import Vue from 'vue'
|
2017-12-13 05:52:14 +00:00
|
|
|
import store from './store'
|
2017-08-21 07:55:46 +00:00
|
|
|
|
2017-12-12 10:14:31 +00:00
|
|
|
// you can set only in production env show the error-log
|
|
|
|
// if (process.env.NODE_ENV === 'production') {
|
2017-12-13 05:52:14 +00:00
|
|
|
Vue.config.errorHandler = function(err, vm, info, a) {
|
|
|
|
Vue.nextTick(() => {
|
|
|
|
store.dispatch('addErrorLog', {
|
|
|
|
err,
|
|
|
|
vm,
|
|
|
|
info,
|
|
|
|
url: window.location.href
|
|
|
|
})
|
|
|
|
console.error(err, info)
|
2017-12-12 10:14:31 +00:00
|
|
|
})
|
2017-08-21 07:55:46 +00:00
|
|
|
}
|
2017-12-12 10:14:31 +00:00
|
|
|
// }
|