Skip to content

Commit 12cf53a

Browse files
author
lucifer
committed
fix: 从 cookie 中解出来格式不对了
1 parent b2a7b07 commit 12cf53a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

middleware/passport.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
const fetch = require("node-fetch");
22
const { encrypt, decrypt } = require("../utils/crypto");
3+
const { success, fail } = require("../utils/request");
34

45
const secret = process.env.secret;
56

@@ -26,7 +27,7 @@ module.exports = async function checkAuth(ctx, next) {
2627
const duser = JSON.parse(duserStr);
2728

2829
if (db.find((q) => q.login === duser.login)) {
29-
ctx.body = duser;
30+
ctx.body = success(duser);
3031
return;
3132
}
3233
} catch (err) {

0 commit comments

Comments
 (0)