From 4e922091e6759d4fd84b0bc03a99f4fa50aff2f9 Mon Sep 17 00:00:00 2001 From: like Date: Mon, 30 Nov 2020 23:05:55 +0800 Subject: [PATCH] big fixed --- auth/index.js | 6 +++--- auth/package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/auth/index.js b/auth/index.js index d428821..e2cf101 100644 --- a/auth/index.js +++ b/auth/index.js @@ -76,15 +76,15 @@ AuthToken.prototype.checkTokenKoaRequest = async function (ctx, next) { if (!token) { ctx.body = { - result: 'fail', error: { code: 401, msg: 'Need user token.' }, data: {} + code: 401, msg: 'Need user token.', data: {} }; return; } let tokenData = await this.checkToken(token, ""); - if (!ret) { + if (!tokenData) { ctx.body = { - result: 'fail', error: { code: 401, msg: 'User token error.' }, data: {} + code: 401, msg: 'Need user token.', data: {} }; return; } diff --git a/auth/package.json b/auth/package.json index 257cd5b..13f4b39 100644 --- a/auth/package.json +++ b/auth/package.json @@ -1,6 +1,6 @@ { "name": "@ehason/auth", - "version": "1.3.1", + "version": "1.3.3", "description": "User auth lib", "main": "index.js", "scripts": {