diff --git a/api/app/lib/controllers/auth/index.js b/api/app/lib/controllers/auth/index.js index 088db8f..d038b79 100644 --- a/api/app/lib/controllers/auth/index.js +++ b/api/app/lib/controllers/auth/index.js @@ -75,10 +75,14 @@ async function login (ctx, next) { // await transaction.rollback(); ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); ctx.status = 400; + let message = typeof error == 'string' ? error + : error.response.body.message || "登录失败" + if (message == '账号或密码错误') { + message = '无此用户,请使用正确的登录信息' + } + ctx.body = { - message: - typeof error == 'string' ? error - : error.response.body.message || "登录失败" + message: message } } }