fix: 优化全局 Message & Notification 展示效果

This commit is contained in:
GraceWalk
2022-10-21 11:38:04 +08:00
parent df655a250c
commit 26e60d8a64
30 changed files with 339 additions and 69 deletions

View File

@@ -1,7 +1,8 @@
/* eslint-disable @typescript-eslint/ban-ts-comment */
// @ts-nocheck
import { notification, Utils } from 'knowdesign';
import { Utils } from 'knowdesign';
import notification from '@src/components/Notification';
export const goLogin = () => {
if (!window.location.pathname.toLowerCase().startsWith('/login')) {
@@ -37,10 +38,9 @@ serviceInstance.interceptors.response.use(
(config: any) => {
const res: { code: number; message: string; data: any } = config.data;
if (res.code !== 0 && res.code !== 200) {
const desc = res.message;
notification.error({
message: desc,
duration: 3,
message: '错误信息',
description: res.message,
});
throw res;
}