Commit e7ca6992 authored by 张子雨's avatar 张子雨

Merge branch 'master' of http://git.quantgroup.cn/ui/merchant-manage-ui into fix/sentryoffsetTop

parents c7889042 9381262b
This diff is collapsed.
/* eslint-disable no-console */ /* eslint-disable no-console */
import * as Sentry from '@sentry/react';
import localStorage from '@/utils/localStorage';
// process.env.SENTRY_ENV !== 'test' 加上测试环境不会报错
if (process.env.NODE_ENV === 'production' && process.env.SENTRY_ENV !== 'test') {
try {
Sentry.init({
dsn: 'https://b3f60c62e1234e26a5b851b9f26fba07@sentry.q-gp.com/34',
release: 'merchant-manage-ui@1.0.0',
maxBreadcrumbs: 50,
tracesSampleRate: 1,
beforeSend: e => {
const err = e.exception?.values || [];
// XXX 不上报[object Object]此类基础库异常
if (err.some(item => item.value.indexOf('ResizeObserver') > -1)) {
return null;
}
return e;
},
});
Sentry.configureScope(scope => {
scope.setUser({
token: localStorage.get('token') || null,
});
});
} catch (e) {
console.log('Sentry无法加载', e);
}
}
export const dva = { export const dva = {
config: { config: {
......
...@@ -100,9 +100,12 @@ class Socket extends EventEmitter { ...@@ -100,9 +100,12 @@ class Socket extends EventEmitter {
}; };
onerror = e => { onerror = e => {
console.log('ws: error', e); try {
this.socket = null; this.socket = null;
this.event.emit('error', e); this.event.emit('error', e);
} catch {
console.log('ws: error', e);
}
}; };
sendMessage = value => { sendMessage = value => {
......
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