mirror of
https://github.com/certd/certd.git
synced 2026-04-14 12:30:54 +08:00
chore:
This commit is contained in:
@@ -8,7 +8,9 @@ import { SysInstallInfo } from '../system/service/models.js';
|
||||
export type PreBindUserReq = {
|
||||
userId: number;
|
||||
};
|
||||
|
||||
export type BindUserReq = {
|
||||
userId: number;
|
||||
};
|
||||
/**
|
||||
*/
|
||||
@Provide()
|
||||
@@ -35,4 +37,20 @@ export class BasicController extends BaseController {
|
||||
|
||||
return this.ok({});
|
||||
}
|
||||
|
||||
@Post('/bindUser', { summary: 'sys:settings:edit' })
|
||||
public async bindUser(@Body(ALL) body: BindUserReq) {
|
||||
const installInfo: SysInstallInfo = await this.sysSettingsService.getSetting(SysInstallInfo);
|
||||
installInfo.bindUserId = body.userId;
|
||||
await this.sysSettingsService.saveSetting(installInfo);
|
||||
return this.ok({});
|
||||
}
|
||||
|
||||
@Post('/unbindUser', { summary: 'sys:settings:edit' })
|
||||
public async unbindUser() {
|
||||
const installInfo: SysInstallInfo = await this.sysSettingsService.getSetting(SysInstallInfo);
|
||||
installInfo.bindUserId = null;
|
||||
await this.sysSettingsService.saveSetting(installInfo);
|
||||
return this.ok({});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,6 +30,8 @@ export class SysInstallInfo extends BaseSettings {
|
||||
static __access__ = 'private';
|
||||
installTime: number;
|
||||
siteId?: string;
|
||||
bindUserId?: number;
|
||||
bindUrl?: string;
|
||||
}
|
||||
|
||||
export class SysLicenseInfo extends BaseSettings {
|
||||
|
||||
Reference in New Issue
Block a user