fix: me switch me bugs
This commit is contained in:
@@ -33,8 +33,8 @@ export class User extends Model {
|
||||
}
|
||||
/**
|
||||
* uid 是用于 orgId 的用户id
|
||||
* @param uid
|
||||
* @returns
|
||||
* @param uid
|
||||
* @returns
|
||||
*/
|
||||
async createToken(uid?: string) {
|
||||
const { id, username, type, supaId } = this;
|
||||
@@ -113,6 +113,9 @@ export class User extends Model {
|
||||
if (this.type === 'org') {
|
||||
if (this.tokenUser && this.tokenUser.uid) {
|
||||
id = this.tokenUser.uid;
|
||||
} else {
|
||||
console.log('getOrgs', 'no uid', this.id, this.username);
|
||||
throw new CustomError('Permission denied');
|
||||
}
|
||||
}
|
||||
const cache = await redis.get(`user:${id}:orgs`);
|
||||
|
||||
Reference in New Issue
Block a user