rez_core 0.0.2 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/module/enterprise/enterprise.module.js +6 -1
- package/dist/module/enterprise/enterprise.module.js.map +1 -1
- package/dist/module/user/service/user.service.d.ts +2 -0
- package/dist/module/user/service/user.service.js +5 -3
- package/dist/module/user/service/user.service.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/module/enterprise/enterprise.module.ts +5 -1
- package/src/module/user/service/user.service.ts +11 -9
package/package.json
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { Module } from '@nestjs/common';
|
|
2
2
|
import { TypeOrmModule } from '@nestjs/typeorm';
|
|
3
3
|
import { UserData } from '../user/entity/user.entity';
|
|
4
|
+
import { OrganizationService } from './service/organization.service';
|
|
5
|
+
import { OrganizationData } from './entity/organization.entity';
|
|
4
6
|
|
|
5
7
|
@Module({
|
|
6
|
-
imports: [],
|
|
8
|
+
imports: [TypeOrmModule.forFeature([OrganizationData])],
|
|
9
|
+
providers:[OrganizationService],
|
|
10
|
+
exports:[OrganizationService]
|
|
7
11
|
})
|
|
8
12
|
export class EnterpriseModule {}
|
|
@@ -9,9 +9,7 @@ import { UserRepository } from '../repository/user.repository';
|
|
|
9
9
|
import { EncryptUtilService } from '../../../utils/service/encryptUtil.service';
|
|
10
10
|
import { ClockIDGenService } from '../../../utils/service/clockIDGenUtil.service';
|
|
11
11
|
import {
|
|
12
|
-
ENTITYTYPE_ROLE
|
|
13
|
-
masterIv,
|
|
14
|
-
masterKey,
|
|
12
|
+
ENTITYTYPE_ROLE
|
|
15
13
|
} from '../../../constant/global.constant';
|
|
16
14
|
import { CreateUserDto } from '../dto/create-user.dto';
|
|
17
15
|
import { UserRoleMappingService } from './user-role-mapping.service';
|
|
@@ -19,8 +17,12 @@ import { UserRoleMapping } from '../entity/user-role-mapping.entity';
|
|
|
19
17
|
import { plainToInstance } from 'class-transformer';
|
|
20
18
|
import { EntityListService } from '../../meta/service/entity-list.service';
|
|
21
19
|
|
|
20
|
+
|
|
21
|
+
|
|
22
22
|
@Injectable()
|
|
23
23
|
export class UserService extends EntityServiceImpl {
|
|
24
|
+
masterKey = process.env.master_key || '';
|
|
25
|
+
masterIv = process.env.master_iv || '';
|
|
24
26
|
constructor(
|
|
25
27
|
entityMasterService: EntityMasterService,
|
|
26
28
|
reflectionHelper: ReflectionHelper,
|
|
@@ -60,14 +62,14 @@ export class UserService extends EntityServiceImpl {
|
|
|
60
62
|
if (userData.password) {
|
|
61
63
|
password = EncryptUtilService.encryptGCM(
|
|
62
64
|
userData.password,
|
|
63
|
-
masterKey,
|
|
64
|
-
masterIv,
|
|
65
|
+
this.masterKey,
|
|
66
|
+
this.masterIv,
|
|
65
67
|
);
|
|
66
68
|
} else {
|
|
67
69
|
password = EncryptUtilService.encryptGCM(
|
|
68
70
|
this.clockIDGenService.idGenerator(''),
|
|
69
|
-
masterKey,
|
|
70
|
-
masterIv,
|
|
71
|
+
this.masterKey,
|
|
72
|
+
this.masterIv,
|
|
71
73
|
);
|
|
72
74
|
}
|
|
73
75
|
userData.password = password;
|
|
@@ -121,8 +123,8 @@ export class UserService extends EntityServiceImpl {
|
|
|
121
123
|
if (userDto.password) {
|
|
122
124
|
const password = EncryptUtilService.encryptGCM(
|
|
123
125
|
userDto.password,
|
|
124
|
-
masterKey,
|
|
125
|
-
masterIv,
|
|
126
|
+
this.masterKey,
|
|
127
|
+
this.masterIv,
|
|
126
128
|
);
|
|
127
129
|
userDto.password = password;
|
|
128
130
|
}
|