|
|
@ -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 |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|