diff --git a/.umirc.ts b/.umirc.ts index 7dc12ee2..25de2061 100644 --- a/.umirc.ts +++ b/.umirc.ts @@ -7,7 +7,7 @@ export default defineConfig({ type: 'none', }, fastRefresh: {}, - favicon: 'http://demo.sc.chinaz.com/Files/pic/iconsico/8002/g5.ico', + favicon: 'https://image.whyour.cn/others/g5.ico', proxy: { '/api': { target: 'http://127.0.0.1:5678/', diff --git a/back/loaders/express.ts b/back/loaders/express.ts index 8da91436..9ad18f40 100644 --- a/back/loaders/express.ts +++ b/back/loaders/express.ts @@ -10,8 +10,8 @@ export default ({ app }: { app: Application }) => { app.enable('trust proxy'); app.use(cors()); - app.use(bodyParser.json()); - app.use(bodyParser.urlencoded({ extended: true })); + app.use(bodyParser.json({ limit: '50mb' })); + app.use(bodyParser.urlencoded({ limit: '50mb', extended: true })); app.use( jwt({ secret: config.secret as string, algorithms: ['HS384'] }).unless({ path: ['/api/login'], diff --git a/src/utils/http.ts b/src/utils/http.ts index f83b32ed..27676a52 100644 --- a/src/utils/http.ts +++ b/src/utils/http.ts @@ -1,11 +1,14 @@ import { extend } from 'umi-request'; -import { history } from 'umi'; +import { notification } from 'antd'; import config from './config'; const time = Date.now(); const errorHandler = function (error: any) { if (error.response) { - console.log(error.response); + const message = error.data + ? error.data.errors && error.data.errors.message + : error.response.statusText; + notification.error({ message }); } else { console.log(error.message); }