fix(error-handler): add error handler middleware before cors

This commit is contained in:
chenos 2022-11-08 17:24:12 +08:00
parent 75b3c974c3
commit 8f623bb22d

View File

@ -49,6 +49,6 @@ export class PluginErrorHandler extends Plugin {
async load() {
this.app.i18n.addResources('zh-CN', this.i18nNs, zhCN);
this.app.i18n.addResources('en-US', this.i18nNs, enUS);
this.app.middleware.nodes.unshift(this.errorHandler.middleware());
this.app.use(this.errorHandler.middleware(), { before: 'cors', tag: 'errorHandler' });
}
}