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