This commit is contained in:
xiaojunnuo
2024-10-10 02:15:05 +08:00
parent b5d8935159
commit f0b2a61246
26 changed files with 262 additions and 120 deletions
@@ -86,7 +86,7 @@ export class UserController extends CrudController<UserService> {
*/
@Post('/mine', { summary: Constants.per.authOnly })
public async mine() {
const id = this.ctx.user.id;
const id = this.getUserId();
const info = await this.service.info(id, ['password']);
return this.ok(info);
}
@@ -96,7 +96,7 @@ export class UserController extends CrudController<UserService> {
*/
@Post('/permissions', { summary: Constants.per.authOnly })
public async permissions() {
const id = this.ctx.user.id;
const id = this.getUserId();
const permissions = await this.service.getUserPermissions(id);
return this.ok(permissions);
}
@@ -106,7 +106,7 @@ export class UserController extends CrudController<UserService> {
*/
@Post('/permissionTree', { summary: Constants.per.authOnly })
public async permissionTree() {
const id = this.ctx.user.id;
const id = this.getUserId();
const permissions = await this.service.getUserPermissions(id);
const tree = this.permissionService.buildTree(permissions);
return this.ok(tree);