mirror of
https://github.com/certd/certd.git
synced 2026-05-15 20:47:31 +08:00
chore: 修改权限判断字段从summary改成description
This commit is contained in:
@@ -15,7 +15,7 @@ export class PermissionController extends CrudController<PermissionService> {
|
||||
return this.service;
|
||||
}
|
||||
|
||||
@Post('/page', { summary: 'sys:auth:per:view' })
|
||||
@Post('/page', { description: 'sys:auth:per:view' })
|
||||
async page(
|
||||
@Body(ALL)
|
||||
body
|
||||
@@ -23,7 +23,7 @@ export class PermissionController extends CrudController<PermissionService> {
|
||||
return await super.page(body);
|
||||
}
|
||||
|
||||
@Post('/add', { summary: 'sys:auth:per:add' })
|
||||
@Post('/add', { description: 'sys:auth:per:add' })
|
||||
async add(
|
||||
@Body(ALL)
|
||||
bean
|
||||
@@ -31,14 +31,14 @@ export class PermissionController extends CrudController<PermissionService> {
|
||||
return await super.add(bean);
|
||||
}
|
||||
|
||||
@Post('/update', { summary: 'sys:auth:per:edit' })
|
||||
@Post('/update', { description: 'sys:auth:per:edit' })
|
||||
async update(
|
||||
@Body(ALL)
|
||||
bean
|
||||
) {
|
||||
return await super.update(bean);
|
||||
}
|
||||
@Post('/delete', { summary: 'sys:auth:per:remove' })
|
||||
@Post('/delete', { description: 'sys:auth:per:remove' })
|
||||
async delete(
|
||||
@Query('id')
|
||||
id: number
|
||||
@@ -46,7 +46,7 @@ export class PermissionController extends CrudController<PermissionService> {
|
||||
return await super.delete(id);
|
||||
}
|
||||
|
||||
@Post('/tree', { summary: 'sys:auth:per:view' })
|
||||
@Post('/tree', { description: 'sys:auth:per:view' })
|
||||
async tree() {
|
||||
const tree = await this.service.tree({});
|
||||
return this.ok(tree);
|
||||
|
||||
@@ -15,7 +15,7 @@ export class RoleController extends CrudController<RoleService> {
|
||||
return this.service;
|
||||
}
|
||||
|
||||
@Post('/page', { summary: 'sys:auth:role:view' })
|
||||
@Post('/page', { description: 'sys:auth:role:view' })
|
||||
async page(
|
||||
@Body(ALL)
|
||||
body
|
||||
@@ -23,13 +23,13 @@ export class RoleController extends CrudController<RoleService> {
|
||||
return await super.page(body);
|
||||
}
|
||||
|
||||
@Post('/list', { summary: 'sys:auth:role:view' })
|
||||
@Post('/list', { description: 'sys:auth:role:view' })
|
||||
async list() {
|
||||
const ret = await this.service.find({});
|
||||
return this.ok(ret);
|
||||
}
|
||||
|
||||
@Post('/add', { summary: 'sys:auth:role:add' })
|
||||
@Post('/add', { description: 'sys:auth:role:add' })
|
||||
async add(
|
||||
@Body(ALL)
|
||||
bean
|
||||
@@ -37,14 +37,14 @@ export class RoleController extends CrudController<RoleService> {
|
||||
return await super.add(bean);
|
||||
}
|
||||
|
||||
@Post('/update', { summary: 'sys:auth:role:edit' })
|
||||
@Post('/update', { description: 'sys:auth:role:edit' })
|
||||
async update(
|
||||
@Body(ALL)
|
||||
bean
|
||||
) {
|
||||
return await super.update(bean);
|
||||
}
|
||||
@Post('/delete', { summary: 'sys:auth:role:remove' })
|
||||
@Post('/delete', { description: 'sys:auth:role:remove' })
|
||||
async delete(
|
||||
@Query('id')
|
||||
id: number
|
||||
@@ -55,7 +55,7 @@ export class RoleController extends CrudController<RoleService> {
|
||||
return await super.delete(id);
|
||||
}
|
||||
|
||||
@Post('/getPermissionTree', { summary: 'sys:auth:role:view' })
|
||||
@Post('/getPermissionTree', { description: 'sys:auth:role:view' })
|
||||
async getPermissionTree(
|
||||
@Query('id')
|
||||
id: number
|
||||
@@ -64,7 +64,7 @@ export class RoleController extends CrudController<RoleService> {
|
||||
return this.ok(ret);
|
||||
}
|
||||
|
||||
@Post('/getPermissionIds', { summary: 'sys:auth:role:view' })
|
||||
@Post('/getPermissionIds', { description: 'sys:auth:role:view' })
|
||||
async getPermissionIds(
|
||||
@Query('id')
|
||||
id: number
|
||||
@@ -78,7 +78,7 @@ export class RoleController extends CrudController<RoleService> {
|
||||
* @param roleId
|
||||
* @param permissionIds
|
||||
*/
|
||||
@Post('/authz', { summary: 'sys:auth:role:edit' })
|
||||
@Post('/authz', { description: 'sys:auth:role:edit' })
|
||||
async authz(@Body('roleId') roleId, @Body('permissionIds') permissionIds) {
|
||||
await this.service.authz(roleId, permissionIds);
|
||||
return this.ok(null);
|
||||
|
||||
@@ -28,7 +28,7 @@ export class UserController extends CrudController<UserService> {
|
||||
return this.service;
|
||||
}
|
||||
|
||||
@Post('/getSimpleUserByIds', {summary: 'sys:auth:user:view'})
|
||||
@Post('/getSimpleUserByIds', {description: 'sys:auth:user:view'})
|
||||
async getSimpleUserByIds(@Body('ids') ids: number[]) {
|
||||
const users = await this.service.find({
|
||||
select: {
|
||||
@@ -47,7 +47,7 @@ export class UserController extends CrudController<UserService> {
|
||||
}
|
||||
|
||||
|
||||
@Post('/getSimpleUsers', {summary: 'sys:auth:user:view'})
|
||||
@Post('/getSimpleUsers', {description: 'sys:auth:user:view'})
|
||||
async getSimpleUsers() {
|
||||
const users = await this.service.find({
|
||||
select: {
|
||||
@@ -61,7 +61,7 @@ export class UserController extends CrudController<UserService> {
|
||||
return this.ok(users);
|
||||
}
|
||||
|
||||
@Post('/page', {summary: 'sys:auth:user:view'})
|
||||
@Post('/page', {description: 'sys:auth:user:view'})
|
||||
async page(
|
||||
@Body(ALL)
|
||||
body
|
||||
@@ -93,7 +93,7 @@ export class UserController extends CrudController<UserService> {
|
||||
return ret;
|
||||
}
|
||||
|
||||
@Post('/add', {summary: 'sys:auth:user:add'})
|
||||
@Post('/add', {description: 'sys:auth:user:add'})
|
||||
async add(
|
||||
@Body(ALL)
|
||||
bean
|
||||
@@ -101,7 +101,7 @@ export class UserController extends CrudController<UserService> {
|
||||
return await super.add(bean);
|
||||
}
|
||||
|
||||
@Post('/update', {summary: 'sys:auth:user:edit'})
|
||||
@Post('/update', {description: 'sys:auth:user:edit'})
|
||||
async update(
|
||||
@Body(ALL)
|
||||
bean
|
||||
@@ -109,7 +109,7 @@ export class UserController extends CrudController<UserService> {
|
||||
return await super.update(bean);
|
||||
}
|
||||
|
||||
@Post('/delete', {summary: 'sys:auth:user:remove'})
|
||||
@Post('/delete', {description: 'sys:auth:user:remove'})
|
||||
async delete(
|
||||
@Query('id')
|
||||
id: number
|
||||
@@ -126,7 +126,7 @@ export class UserController extends CrudController<UserService> {
|
||||
/**
|
||||
* 解除登录锁定
|
||||
*/
|
||||
@Post('/unlockBlock', {summary: "sys:auth:user:edit"})
|
||||
@Post('/unlockBlock', {description: "sys:auth:user:edit"})
|
||||
public async unlockBlock(@Body('id') id: number) {
|
||||
const info = await this.service.info(id, ['password']);
|
||||
this.loginService.clearCacheOnSuccess(info.username)
|
||||
@@ -139,7 +139,7 @@ export class UserController extends CrudController<UserService> {
|
||||
/**
|
||||
* 当前登录用户的个人信息
|
||||
*/
|
||||
@Post('/mine', {summary: Constants.per.authOnly})
|
||||
@Post('/mine', {description: Constants.per.authOnly})
|
||||
public async mine() {
|
||||
const id = this.getUserId();
|
||||
const info = await this.service.info(id, ['password']);
|
||||
@@ -149,7 +149,7 @@ export class UserController extends CrudController<UserService> {
|
||||
/**
|
||||
* 当前登录用户的权限列表
|
||||
*/
|
||||
@Post('/permissions', {summary: Constants.per.authOnly})
|
||||
@Post('/permissions', {description: Constants.per.authOnly})
|
||||
public async permissions() {
|
||||
const id = this.getUserId();
|
||||
const permissions = await this.service.getUserPermissions(id);
|
||||
@@ -159,7 +159,7 @@ export class UserController extends CrudController<UserService> {
|
||||
/**
|
||||
* 当前登录用户的权限树形列表
|
||||
*/
|
||||
@Post('/permissionTree', {summary: Constants.per.authOnly})
|
||||
@Post('/permissionTree', {description: Constants.per.authOnly})
|
||||
public async permissionTree() {
|
||||
const id = this.getUserId();
|
||||
const permissions = await this.service.getUserPermissions(id);
|
||||
|
||||
Reference in New Issue
Block a user