mirror of
https://github.com/certd/certd.git
synced 2026-04-14 04:20:52 +08:00
chore: project fix
This commit is contained in:
@@ -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}
|
||||
|
||||
@@ -80,7 +80,7 @@ const development = {
|
||||
type: 'better-sqlite3',
|
||||
database: './data/db.sqlite',
|
||||
synchronize: false, // 如果第一次使用,不存在表,有同步的需求可以写 true
|
||||
logging: false,
|
||||
logging: true,
|
||||
highlightSql: false,
|
||||
|
||||
// 配置实体模型 或者 entities: '/entity',
|
||||
|
||||
@@ -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,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user