mirror of
https://github.com/certd/certd.git
synced 2026-04-24 20:57:26 +08:00
chore: project fix
This commit is contained in:
@@ -118,7 +118,7 @@ export abstract class BaseController {
|
|||||||
if(allowAdmin){
|
if(allowAdmin){
|
||||||
await authService.checkUserIdButAllowAdmin(this.ctx, service, id);
|
await authService.checkUserIdButAllowAdmin(this.ctx, service, id);
|
||||||
}else{
|
}else{
|
||||||
await authService.checkUserId(this.ctx, service, id);
|
await authService.checkUserId( service, id, userId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return {projectId,userId}
|
return {projectId,userId}
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ const development = {
|
|||||||
type: 'better-sqlite3',
|
type: 'better-sqlite3',
|
||||||
database: './data/db.sqlite',
|
database: './data/db.sqlite',
|
||||||
synchronize: false, // 如果第一次使用,不存在表,有同步的需求可以写 true
|
synchronize: false, // 如果第一次使用,不存在表,有同步的需求可以写 true
|
||||||
logging: false,
|
logging: true,
|
||||||
highlightSql: false,
|
highlightSql: false,
|
||||||
|
|
||||||
// 配置实体模型 或者 entities: '/entity',
|
// 配置实体模型 或者 entities: '/entity',
|
||||||
|
|||||||
@@ -138,21 +138,21 @@ export class NotificationService extends BaseService<NotificationEntity> {
|
|||||||
if (userId==null) {
|
if (userId==null) {
|
||||||
throw new ValidateException('userId不能为空');
|
throw new ValidateException('userId不能为空');
|
||||||
}
|
}
|
||||||
|
const query:any = {
|
||||||
|
userId,
|
||||||
|
}
|
||||||
|
if (projectId){
|
||||||
|
query.projectId = projectId
|
||||||
|
}
|
||||||
await this.repository.update(
|
await this.repository.update(
|
||||||
{
|
query,
|
||||||
userId,
|
|
||||||
projectId,
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
isDefault: false,
|
isDefault: false,
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
query.id = id
|
||||||
await this.repository.update(
|
await this.repository.update(
|
||||||
{
|
query,
|
||||||
id,
|
|
||||||
userId,
|
|
||||||
projectId,
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
isDefault: true,
|
isDefault: true,
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user