big fixed

This commit is contained in:
like 2020-11-30 23:05:55 +08:00
parent 8d221222a9
commit 4e922091e6
2 changed files with 4 additions and 4 deletions

View File

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

View File

@ -1,6 +1,6 @@
{
"name": "@ehason/auth",
"version": "1.3.1",
"version": "1.3.3",
"description": "User auth lib",
"main": "index.js",
"scripts": {