|
|
@@ -242,7 +242,8 @@ export abstract class GenericCrudService<T extends ObjectLiteral> {
|
|
|
} = this.userTrackingOptions;
|
|
|
|
|
|
// 设置创建人
|
|
|
- if (isCreate && createdByField) {
|
|
|
+ // 只有在数据中不存在该字段时才设置,避免覆盖管理员传入的用户ID
|
|
|
+ if (isCreate && createdByField && !data[createdByField]) {
|
|
|
data[createdByField] = userId;
|
|
|
}
|
|
|
|