|
@@ -11,6 +11,7 @@ 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';
|
|
import { CustomErrorFilter } from './filter/customError.filter';
|
|
|
|
+import { CheckTokenMiddleware } from './middleware/checkToken.middleware';
|
|
|
|
|
|
const axiosResponse = response => {
|
|
const axiosResponse = response => {
|
|
if (response.status === 200) return response.data;
|
|
if (response.status === 200) return response.data;
|
|
@@ -74,6 +75,7 @@ export class FreeConfiguration {
|
|
}
|
|
}
|
|
async onReady(container: IMidwayContainer) {
|
|
async onReady(container: IMidwayContainer) {
|
|
// TODO something
|
|
// TODO something
|
|
|
|
+ this.app.getMiddleware().insertFirst(CheckTokenMiddleware);
|
|
this.app.getMiddleware().insertLast(ResponseMiddleware);
|
|
this.app.getMiddleware().insertLast(ResponseMiddleware);
|
|
this.app.useFilter([CustomErrorFilter]);
|
|
this.app.useFilter([CustomErrorFilter]);
|
|
// typegoose设置
|
|
// typegoose设置
|