chore: project fix

This commit is contained in:
xiaojunnuo
2026-03-05 00:11:08 +08:00
parent 5ee3874b7e
commit dd9a7cf5d7
3 changed files with 11 additions and 11 deletions

View File

@@ -118,7 +118,7 @@ export abstract class BaseController {
if(allowAdmin){
await authService.checkUserIdButAllowAdmin(this.ctx, service, id);
}else{
await authService.checkUserId(this.ctx, service, id);
await authService.checkUserId( service, id, userId);
}
}
return {projectId,userId}

View File

@@ -80,7 +80,7 @@ const development = {
type: 'better-sqlite3',
database: './data/db.sqlite',
synchronize: false, // 如果第一次使用,不存在表,有同步的需求可以写 true
logging: false,
logging: true,
highlightSql: false,
// 配置实体模型 或者 entities: '/entity',

View File

@@ -138,21 +138,21 @@ export class NotificationService extends BaseService<NotificationEntity> {
if (userId==null) {
throw new ValidateException('userId不能为空');
}
const query:any = {
userId,
}
if (projectId){
query.projectId = projectId
}
await this.repository.update(
{
userId,
projectId,
},
query,
{
isDefault: false,
}
);
query.id = id
await this.repository.update(
{
id,
userId,
projectId,
},
query,
{
isDefault: true,
}