mirror of
https://github.com/certd/certd.git
synced 2026-04-23 11:37:23 +08:00
chore: project userid fixed -1
This commit is contained in:
@@ -21,12 +21,18 @@ export class BasicController extends BaseController {
|
||||
@Post('/preBindUser', { summary: 'sys:settings:edit' })
|
||||
public async preBindUser(@Body(ALL) body: PreBindUserReq) {
|
||||
// 设置缓存内容
|
||||
if (body.userId == null || body.userId <= 0) {
|
||||
throw new Error("用户ID不能为空");
|
||||
}
|
||||
await this.plusService.userPreBind(body.userId);
|
||||
return this.ok({});
|
||||
}
|
||||
|
||||
@Post('/bindUser', { summary: 'sys:settings:edit' })
|
||||
public async bindUser(@Body(ALL) body: BindUserReq) {
|
||||
if (body.userId == null || body.userId <= 0) {
|
||||
throw new Error("用户ID不能为空");
|
||||
}
|
||||
const installInfo: SysInstallInfo = await this.sysSettingsService.getSetting(SysInstallInfo);
|
||||
installInfo.bindUserId = body.userId;
|
||||
await this.sysSettingsService.saveSetting(installInfo);
|
||||
|
||||
@@ -14,7 +14,7 @@ export class SysAddonController extends AddonController {
|
||||
|
||||
async getProjectUserId(permission:string){
|
||||
return {
|
||||
projectId:null,userId:0
|
||||
projectId:null,userId:0 //0为系统级别
|
||||
}
|
||||
}
|
||||
getUserId() {
|
||||
|
||||
@@ -40,7 +40,7 @@ export class SysProjectController extends CrudController<ProjectEntity> {
|
||||
bean.userId = this.getUserId();
|
||||
return super.add({
|
||||
...bean,
|
||||
userId:0,
|
||||
userId:-1, //企业用户id固定为-1
|
||||
adminId: bean.userId,
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user