diff --git a/package.json b/package.json index 8c8f1597..bc8e912e 100644 --- a/package.json +++ b/package.json @@ -60,6 +60,7 @@ "escape-html": "^1.0.3", "file-saver": "^2.0.2", "history": "4.7.2", + "html-entities": "^2.3.5", "intersection-observer": "^0.11.0", "intl-messageformat": "7.8.4", "invariant": "^2.2.4", diff --git a/src/components/Notify/index.jsx b/src/components/Notify/index.jsx index c2535038..3865c062 100644 --- a/src/components/Notify/index.jsx +++ b/src/components/Notify/index.jsx @@ -27,6 +27,7 @@ import globalRootStore from 'stores/root'; import { unescapeHtml } from 'utils/index'; import { statusMap } from 'src/utils/code'; import { isEmpty, isString } from 'lodash'; +import { decode } from 'html-entities'; import styles from './index.less'; const open = (args) => { @@ -140,6 +141,8 @@ const errorWithDetail = (err, title) => { nTitle += statusMap[status]; } } else { + const decodeErr = + err && isString(err) ? decode(err, { level: 'html5' }) : err; // prettier-ignore description = err ? { component={