fix: fix switch orgUser is not org

This commit is contained in:
2025-02-17 00:32:06 +08:00
parent a52ae9ea3a
commit 0bf31c94b7
2 changed files with 6 additions and 2 deletions

View File

@@ -167,6 +167,9 @@ app
if (!orgUser) {
ctx.throw('org user not found');
}
if (orgUser.type !== 'org') {
ctx.throw('change user is not org, please check');
}
const user = await Org.findOne({ where: { username } });
const users = user.users;
const index = users.findIndex((u) => u.uid === me.id);