ai review

This commit is contained in:
lik
2026-09-01 21:49:17 +08:00
parent 390c871d35
commit 98c9026485
14 changed files with 288 additions and 262 deletions
+2 -5
View File
@@ -118,11 +118,8 @@ AuthToken.prototype.koaRequest = async function (ctx, next) {
let tokenData = await this.get(token);
if (tokenData && tokenData.uid) {
const { DBModel } = await import("../models/index.js");
const user = await DBModel.User.findOne({ _id: tokenData.uid });
if (user) {
ctx.userInfo = user;
}
// 用户体系在外部服务(user 服务),tokenData 中已包含 uid
ctx.userInfo = tokenData;
}
ctx.authToken = this;