|
@@ -10,7 +10,7 @@ import { ServiceError, FrameworkErrorEnum } from './error/service.error';
|
|
import { IMidwayContainer, Inject, MidwayConfigService } from '@midwayjs/core';
|
|
import { IMidwayContainer, Inject, MidwayConfigService } from '@midwayjs/core';
|
|
import * as upload from '@midwayjs/upload';
|
|
import * as upload from '@midwayjs/upload';
|
|
import { UseFile } from './entity/useFile.entity';
|
|
import { UseFile } from './entity/useFile.entity';
|
|
-
|
|
|
|
|
|
+import { CustomErrorFilter } from './filter/customError.filter';
|
|
|
|
|
|
const axiosResponse = response => {
|
|
const axiosResponse = response => {
|
|
if (response.status === 200) return response.data;
|
|
if (response.status === 200) return response.data;
|
|
@@ -70,6 +70,7 @@ export class FreeConfiguration {
|
|
async onReady(container: IMidwayContainer) {
|
|
async onReady(container: IMidwayContainer) {
|
|
// TODO something
|
|
// TODO something
|
|
this.app.getMiddleware().insertLast(ResponseMiddleware);
|
|
this.app.getMiddleware().insertLast(ResponseMiddleware);
|
|
|
|
+ this.app.useFilter([CustomErrorFilter])
|
|
// typegoose设置
|
|
// typegoose设置
|
|
Typegoose.setGlobalOptions({
|
|
Typegoose.setGlobalOptions({
|
|
schemaOptions: {
|
|
schemaOptions: {
|