mirror of https://github.com/certd/certd
chore:
parent
8e03e8463f
commit
ab53c601bf
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue