mirror of
https://github.com/whyour/qinglong.git
synced 2025-07-07 11:56:08 +08:00
增加文件保存限制,增加接口错误提醒
This commit is contained in:
parent
b8e3a451c3
commit
b10e77dce6
|
@ -7,7 +7,7 @@ export default defineConfig({
|
||||||
type: 'none',
|
type: 'none',
|
||||||
},
|
},
|
||||||
fastRefresh: {},
|
fastRefresh: {},
|
||||||
favicon: 'http://demo.sc.chinaz.com/Files/pic/iconsico/8002/g5.ico',
|
favicon: 'https://image.whyour.cn/others/g5.ico',
|
||||||
proxy: {
|
proxy: {
|
||||||
'/api': {
|
'/api': {
|
||||||
target: 'http://127.0.0.1:5678/',
|
target: 'http://127.0.0.1:5678/',
|
||||||
|
|
|
@ -10,8 +10,8 @@ export default ({ app }: { app: Application }) => {
|
||||||
app.enable('trust proxy');
|
app.enable('trust proxy');
|
||||||
app.use(cors());
|
app.use(cors());
|
||||||
|
|
||||||
app.use(bodyParser.json());
|
app.use(bodyParser.json({ limit: '50mb' }));
|
||||||
app.use(bodyParser.urlencoded({ extended: true }));
|
app.use(bodyParser.urlencoded({ limit: '50mb', extended: true }));
|
||||||
app.use(
|
app.use(
|
||||||
jwt({ secret: config.secret as string, algorithms: ['HS384'] }).unless({
|
jwt({ secret: config.secret as string, algorithms: ['HS384'] }).unless({
|
||||||
path: ['/api/login'],
|
path: ['/api/login'],
|
||||||
|
|
|
@ -1,11 +1,14 @@
|
||||||
import { extend } from 'umi-request';
|
import { extend } from 'umi-request';
|
||||||
import { history } from 'umi';
|
import { notification } from 'antd';
|
||||||
import config from './config';
|
import config from './config';
|
||||||
|
|
||||||
const time = Date.now();
|
const time = Date.now();
|
||||||
const errorHandler = function (error: any) {
|
const errorHandler = function (error: any) {
|
||||||
if (error.response) {
|
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 {
|
} else {
|
||||||
console.log(error.message);
|
console.log(error.message);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user