chore: 修改权限判断字段从summary改成description

This commit is contained in:
xiaojunnuo
2026-03-15 16:20:20 +08:00
parent b88ee33ae4
commit 25e361b9f9
60 changed files with 385 additions and 385 deletions
@@ -38,58 +38,58 @@ export class SysSettingsController extends CrudController<SysSettingsService> {
return this.service;
}
@Post('/page', { summary: 'sys:settings:view' })
@Post('/page', { description: 'sys:settings:view' })
async page(@Body(ALL) body) {
return super.page(body);
}
@Post('/list', { summary: 'sys:settings:view' })
@Post('/list', { description: 'sys:settings:view' })
async list(@Body(ALL) body) {
return super.list(body);
}
@Post('/add', { summary: 'sys:settings:edit' })
@Post('/add', { description: 'sys:settings:edit' })
async add(@Body(ALL) bean) {
return super.add(bean);
}
@Post('/update', { summary: 'sys:settings:edit' })
@Post('/update', { description: 'sys:settings:edit' })
async update(@Body(ALL) bean) {
await this.service.checkUserId(bean.id, this.getUserId());
return super.update(bean);
}
@Post('/info', { summary: 'sys:settings:view' })
@Post('/info', { description: 'sys:settings:view' })
async info(@Query('id') id: number) {
await this.service.checkUserId(id, this.getUserId());
return super.info(id);
}
@Post('/delete', { summary: 'sys:settings:edit' })
@Post('/delete', { description: 'sys:settings:edit' })
async delete(@Query('id') id: number) {
await this.service.checkUserId(id, this.getUserId());
return super.delete(id);
}
@Post('/save', { summary: 'sys:settings:edit' })
@Post('/save', { description: 'sys:settings:edit' })
async save(@Body(ALL) bean: SysSettingsEntity) {
await this.service.save(bean);
return this.ok({});
}
@Post('/get', { summary: 'sys:settings:view' })
@Post('/get', { description: 'sys:settings:view' })
async get(@Query('key') key: string) {
const entity = await this.service.getByKey(key);
return this.ok(entity);
}
// savePublicSettings
@Post('/getEmailSettings', { summary: 'sys:settings:view' })
@Post('/getEmailSettings', { description: 'sys:settings:view' })
async getEmailSettings(@Body(ALL) body) {
const conf = await getEmailSettings(this.service, this.userSettingsService);
return this.ok(conf);
}
@Post('/getEmailTemplates', { summary: 'sys:settings:view' })
@Post('/getEmailTemplates', { description: 'sys:settings:view' })
async getEmailTemplates(@Body(ALL) body) {
const conf = await getEmailSettings(this.service, this.userSettingsService);
const templates = conf.templates || {}
@@ -108,7 +108,7 @@ export class SysSettingsController extends CrudController<SysSettingsService> {
return this.ok(proviers);
}
@Post('/saveEmailSettings', { summary: 'sys:settings:edit' })
@Post('/saveEmailSettings', { description: 'sys:settings:edit' })
async saveEmailSettings(@Body(ALL) body) {
const conf = await getEmailSettings(this.service, this.userSettingsService);
merge(conf, body);
@@ -116,7 +116,7 @@ export class SysSettingsController extends CrudController<SysSettingsService> {
return this.ok(conf);
}
@Post('/getSysSettings', { summary: 'sys:settings:view' })
@Post('/getSysSettings', { description: 'sys:settings:view' })
async getSysSettings() {
const publicSettings = await this.service.getPublicSettings();
let privateSettings = await this.service.getPrivateSettings();
@@ -125,7 +125,7 @@ export class SysSettingsController extends CrudController<SysSettingsService> {
}
// savePublicSettings
@Post('/saveSysSettings', { summary: 'sys:settings:edit' })
@Post('/saveSysSettings', { description: 'sys:settings:edit' })
async saveSysSettings(@Body(ALL) body: { public: SysPublicSettings; private: SysPrivateSettings }) {
const publicSettings = await this.service.getPublicSettings();
const privateSettings = await this.service.getPrivateSettings();
@@ -135,13 +135,13 @@ export class SysSettingsController extends CrudController<SysSettingsService> {
await this.service.savePrivateSettings(privateSettings);
return this.ok({});
}
@Post('/stopOtherUserTimer', { summary: 'sys:settings:edit' })
@Post('/stopOtherUserTimer', { description: 'sys:settings:edit' })
async stopOtherUserTimer(@Body(ALL) body) {
await this.pipelineService.stopOtherUserPipeline(1);
return this.ok({});
}
@Post('/testProxy', { summary: 'sys:settings:edit' })
@Post('/testProxy', { description: 'sys:settings:edit' })
async testProxy(@Body(ALL) body) {
const google = 'https://www.google.com/';
const baidu = 'https://www.baidu.com/';
@@ -179,13 +179,13 @@ export class SysSettingsController extends CrudController<SysSettingsService> {
});
}
@Post('/testSms', { summary: 'sys:settings:edit' })
@Post('/testSms', { description: 'sys:settings:edit' })
async testSms(@Body(ALL) body) {
await this.codeService.sendSmsCode(body.phoneCode, body.mobile );
return this.ok({});
}
@Post('/getSmsTypeDefine', { summary: 'sys:settings:view' })
@Post('/getSmsTypeDefine', { description: 'sys:settings:view' })
async getSmsTypeDefine(@Body('type') type: string) {
const define =await SmsServiceFactory.getDefine(type);
return this.ok(define);
@@ -193,7 +193,7 @@ export class SysSettingsController extends CrudController<SysSettingsService> {
@Post("/safe/get", { summary: "sys:settings:view" })
@Post("/safe/get", { description: "sys:settings:view" })
async safeGet() {
const res = await this.service.getSetting<SysSafeSetting>(SysSafeSetting);
const clone:SysSafeSetting = cloneDeep(res);
@@ -201,7 +201,7 @@ export class SysSettingsController extends CrudController<SysSettingsService> {
return this.ok(clone);
}
@Post("/safe/save", { summary: "sys:settings:edit" })
@Post("/safe/save", { description: "sys:settings:edit" })
async safeSave(@Body(ALL) body: any) {
if(body.hidden.openPassword){
body.hidden.openPassword = utils.hash.md5(body.hidden.openPassword);
@@ -217,13 +217,13 @@ export class SysSettingsController extends CrudController<SysSettingsService> {
}
@Post("/captchaTest", { summary: "sys:settings:edit" })
@Post("/captchaTest", { description: "sys:settings:edit" })
async captchaTest(@Body(ALL) body: any,@RequestIP() remoteIp: string) {
await this.codeService.checkCaptcha(body,{remoteIp});
return this.ok({});
}
@Post('/oauth/providers', { summary: 'sys:settings:view' })
@Post('/oauth/providers', { description: 'sys:settings:view' })
async oauthProviders() {
const list = await addonRegistry.getDefineList("oauth");
return this.ok(list);