feat: cookie和domain优化

This commit is contained in:
2025-02-27 18:21:47 +08:00
parent bb571631d6
commit 409067f13f
7 changed files with 41 additions and 26 deletions

View File

@@ -34,15 +34,14 @@ app
}
user.setTokenUser(tokenUser);
const orgs = await user.getOrgs();
if (orgs.includes('admin')) {
ctx.body = 'admin';
ctx.nextQuery = ctx.query;
} else {
ctx.throw(403, 'forbidden');
}
} catch (e) {
console.error('auth-admin error', e);
console.error(`auth-admin error`, e);
console.error('tokenUser', tokenUser?.id, tokenUser?.username, tokenUser?.uid);
ctx.throw(500, e.message);
}
})