mirror of
https://github.com/cool-team-official/cool-admin-midway.git
synced 2025-12-11 00:22:49 +00:00
v8.x
This commit is contained in:
parent
33ece89a50
commit
3c4f38be74
@ -53,7 +53,7 @@
|
||||
},
|
||||
"scripts": {
|
||||
"start": "NODE_ENV=production node ./bootstrap.js",
|
||||
"dev": "rimraf src/index.ts && cross-env NODE_ENV=local mwtsc --cleanOutDir --watch --run @midwayjs/mock/app.js",
|
||||
"dev": "rimraf src/index.ts && cool check && cross-env NODE_ENV=local mwtsc --cleanOutDir --watch --run @midwayjs/mock/app.js",
|
||||
"test": "cross-env NODE_ENV=unittest jest",
|
||||
"cov": "jest --coverage",
|
||||
"lint": "mwts check",
|
||||
|
||||
@ -38,7 +38,7 @@ export class BaseTranslateMiddleware
|
||||
this.logger.error(error);
|
||||
// 处理翻译消息
|
||||
if (error.name == 'CoolCommException') {
|
||||
if (language && error.message && error.message !== 'success') {
|
||||
if (error.message && error.message !== 'success') {
|
||||
ctx.status = error.statusCode || 200;
|
||||
ctx.body = {
|
||||
code: RESCODE.COMMFAIL,
|
||||
@ -51,6 +51,11 @@ export class BaseTranslateMiddleware
|
||||
return;
|
||||
}
|
||||
}
|
||||
ctx.status = 500;
|
||||
ctx.body = {
|
||||
code: RESCODE.COMMFAIL,
|
||||
message: 'Service Error',
|
||||
};
|
||||
return;
|
||||
}
|
||||
if (!this.config.enable) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user