fix: fix switch orgUser is not org
This commit is contained in:
parent
a52ae9ea3a
commit
0bf31c94b7
@ -9,7 +9,7 @@ app
|
||||
path: 'micro-app',
|
||||
key: 'upload',
|
||||
middleware: ['auth'],
|
||||
description: 'Upload micro app',
|
||||
description: 'Upload micro app in server',
|
||||
})
|
||||
.define(async (ctx) => {
|
||||
const { files, collection } = ctx.query?.data;
|
||||
@ -52,7 +52,7 @@ app
|
||||
.route({
|
||||
path: 'micro-app',
|
||||
key: 'deploy',
|
||||
description: 'Deploy micro app',
|
||||
description: 'Deploy micro app in server',
|
||||
})
|
||||
.define(async (ctx) => {
|
||||
const { id, key } = ctx.query?.data;
|
||||
@ -85,6 +85,7 @@ app
|
||||
.route({
|
||||
path: 'micro-app',
|
||||
key: 'unload',
|
||||
description: 'Unload micro app in server',
|
||||
})
|
||||
.define(async (ctx) => {
|
||||
const { key } = ctx.query?.data;
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user