Skip to content

Commit 7971029

Browse files
author
lucifer
committed
fix: 非付费用户解析
1 parent caff0fe commit 7971029

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

middleware/mockUserInfo.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ module.exports = async function checkAuth(ctx, next) {
66
login: "azl397985856",
77
avatar_url: "https://avatars.githubusercontent.com/u/12479470?v=4",
88
name: "lucifer",
9-
pay: false,
9+
pay: true,
1010
};
1111

1212
await next();

middleware/passport.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,10 @@ module.exports = async function checkAuth(ctx, next) {
2929
try {
3030
const duser = JSON.parse(duserStr);
3131

32-
if (db.find((q) => q.login === duser.login)) {
33-
ctx.session.user = duser;
34-
await next();
35-
return;
36-
}
32+
ctx.session.user = duser;
33+
34+
await next();
35+
return;
3736
} catch (err) {
3837
console.log("token 解析失败:", err);
3938
return;

0 commit comments

Comments
 (0)