diff --git a/package.json b/package.json index f7ece8583b023c03c9274f9b99e7f2e5ba6c6586..bfd2b9e5c5bb479d5e6163079e98925c4b36bd39 100755 --- a/package.json +++ b/package.json @@ -68,11 +68,11 @@ "lint-staged": "^4.3.0", "mockjs": "^1.0.1-beta3", "pro-download": "^1.0.0", - "raven-js": "^3.20.1", "react-test-renderer": "^16.0.0", "redbox-react": "^1.3.2", "roadhog": "^1.3.1", "roadhog-api-doc": "^0.2.5", + "rollbar-browser": "^1.9.5", "stylelint": "^8.1.0", "stylelint-config-standard": "^17.0.0" }, diff --git a/src/index.js b/src/index.js index c5eecd8bd817066e0b7af826454c8204ae54b91a..c2c10cc4370e720a267c5f957a5504d30bfcc9b5 100644 --- a/src/index.js +++ b/src/index.js @@ -2,7 +2,7 @@ import dva from 'dva'; import 'moment/locale/zh-cn'; import './polyfill'; import './g2'; -import './raven'; +import './rollbar'; // import browserHistory from 'history/createBrowserHistory'; import './index.less'; diff --git a/src/raven.js b/src/raven.js deleted file mode 100644 index 2f51aab7b4234c5c5635241486ab92a0059656c1..0000000000000000000000000000000000000000 --- a/src/raven.js +++ /dev/null @@ -1,6 +0,0 @@ -import Raven from 'raven-js'; - -// Track error by https://sentry.io/ -if (location.host === 'preview.pro.ant.design') { - Raven.config('https://969e74e863854cf0ae7d7d72f534bd3e@sentry.io/247221').install(); -} diff --git a/src/rollbar.js b/src/rollbar.js new file mode 100644 index 0000000000000000000000000000000000000000..94810fbd156cd5c3e72fcfaf8106a97ee8e3b398 --- /dev/null +++ b/src/rollbar.js @@ -0,0 +1,12 @@ +import Rollbar from 'rollbar-browser'; + +// Track error by https://sentry.io/ +if (location.host === 'preview.pro.ant.design') { + Rollbar.init({ + accessToken: '033ca6d7c0eb4cc1831cf470c2649971', + captureUncaught: true, + payload: { + environment: 'production', + }, + }); +}