perf: 优化

This commit is contained in:
熊潇 2025-02-17 11:46:12 +08:00
parent 0bf31c94b7
commit 0144f94edd
3 changed files with 7 additions and 3 deletions

@ -1 +1 @@
Subproject commit a9afc2ffea3dbe91a91e0e93c8ac0e6b8a71c5a6 Subproject commit 79a9568a87536aa8e467182f371c95b8a2f25b8b

View File

@ -213,6 +213,7 @@ app
ctx.body = { ctx.body = {
key: app.key, key: app.key,
version: app.version, version: app.version,
appManager: am
}; };
}) })
.addTo(app); .addTo(app);

View File

@ -167,8 +167,11 @@ app
if (!orgUser) { if (!orgUser) {
ctx.throw('org user not found'); ctx.throw('org user not found');
} }
if (orgUser.type !== 'org') { if (orgUser.type === 'user') {
ctx.throw('change user is not org, please check'); // 想转换的type===org, 但实际上这个用户名是一个用户, 比如org调用switchOrg root
const token = await orgUser.createToken(null, loginType);
ctx.body = token;
return;
} }
const user = await Org.findOne({ where: { username } }); const user = await Org.findOne({ where: { username } });
const users = user.users; const users = user.users;