@saihu/common 1.1.80 → 1.1.81

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.
@@ -7,6 +7,7 @@ export interface Operlog {
7
7
  org_id: string;
8
8
  oper_url: string;
9
9
  oper_ip: string;
10
+ headers?: string;
10
11
  oper_param: string;
11
12
  json_result: string;
12
13
  status: number;
@@ -1 +1 @@
1
- {"version":3,"file":"operlog.dto.d.ts","sourceRoot":"","sources":["../../src/dto/operlog.dto.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,OAAO;IAEtB,KAAK,EAAE,MAAM,CAAC;IAEd,MAAM,EAAE,MAAM,CAAC;IAEf,cAAc,EAAE,MAAM,CAAC;IAEvB,UAAU,EAAE,MAAM,CAAC;IAEnB,SAAS,EAAE,MAAM,CAAC;IAElB,MAAM,EAAE,MAAM,CAAC;IAEf,QAAQ,EAAE,MAAM,CAAC;IAEjB,OAAO,EAAE,MAAM,CAAC;IAEhB,UAAU,EAAE,MAAM,CAAC;IAEnB,WAAW,EAAE,MAAM,CAAC;IAEpB,MAAM,EAAE,MAAM,CAAC;IAEf,SAAS,EAAE,MAAM,CAAC;IAElB,SAAS,EAAE,MAAM,CAAC;IAElB,SAAS,EAAE,MAAM,CAAC;CACnB"}
1
+ {"version":3,"file":"operlog.dto.d.ts","sourceRoot":"","sources":["../../src/dto/operlog.dto.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,OAAO;IAEtB,KAAK,EAAE,MAAM,CAAC;IAEd,MAAM,EAAE,MAAM,CAAC;IAEf,cAAc,EAAE,MAAM,CAAC;IAEvB,UAAU,EAAE,MAAM,CAAC;IAEnB,SAAS,EAAE,MAAM,CAAC;IAElB,MAAM,EAAE,MAAM,CAAC;IAEf,QAAQ,EAAE,MAAM,CAAC;IAEjB,OAAO,EAAE,MAAM,CAAC;IAEhB,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,UAAU,EAAE,MAAM,CAAC;IAEnB,WAAW,EAAE,MAAM,CAAC;IAEpB,MAAM,EAAE,MAAM,CAAC;IAEf,SAAS,EAAE,MAAM,CAAC;IAElB,SAAS,EAAE,MAAM,CAAC;IAElB,SAAS,EAAE,MAAM,CAAC;CACnB"}
@@ -17,5 +17,9 @@ export declare class OperlogInterceptor implements NestInterceptor {
17
17
  * 获取请求参数
18
18
  */
19
19
  private getRequestParams;
20
+ /**
21
+ * 获取请求头
22
+ */
23
+ private getRequestHeaders;
20
24
  }
21
25
  //# sourceMappingURL=operlog.interceptor.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"operlog.interceptor.d.ts","sourceRoot":"","sources":["../../src/interceptors/operlog.interceptor.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,eAAe,EACf,gBAAgB,EAChB,WAAW,EAGZ,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAElC,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAKtE,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAKlE,qBACa,kBAAmB,YAAW,eAAe;IAMtD,OAAO,CAAC,SAAS;IACS,OAAO,CAAC,QAAQ,CAAC,eAAe;IAE1D,OAAO,CAAC,QAAQ,CAAC,OAAO;IAR1B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAuC;IAC9D,OAAO,CAAC,SAAS,CAAU;IAC3B,OAAO,CAAC,SAAS,CAAW;gBAGlB,SAAS,EAAE,SAAS,EACe,eAAe,EAAE,eAAe,EAE1D,OAAO,EAAE,mBAAmB;IAa/C,SAAS,CAAC,OAAO,EAAE,gBAAgB,EAAE,IAAI,EAAE,WAAW,GAAG,UAAU,CAAC,GAAG,CAAC;IAgFxE,OAAO,CAAC,WAAW;IAiCnB;;OAEG;IACH,OAAO,CAAC,gBAAgB;CAWzB"}
1
+ {"version":3,"file":"operlog.interceptor.d.ts","sourceRoot":"","sources":["../../src/interceptors/operlog.interceptor.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,eAAe,EACf,gBAAgB,EAChB,WAAW,EAGZ,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAElC,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAKtE,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAKlE,qBACa,kBAAmB,YAAW,eAAe;IAMtD,OAAO,CAAC,SAAS;IACS,OAAO,CAAC,QAAQ,CAAC,eAAe;IAE1D,OAAO,CAAC,QAAQ,CAAC,OAAO;IAR1B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAuC;IAC9D,OAAO,CAAC,SAAS,CAAU;IAC3B,OAAO,CAAC,SAAS,CAAW;gBAGlB,SAAS,EAAE,SAAS,EACe,eAAe,EAAE,eAAe,EAE1D,OAAO,EAAE,mBAAmB;IAa/C,SAAS,CAAC,OAAO,EAAE,gBAAgB,EAAE,IAAI,EAAE,WAAW,GAAG,UAAU,CAAC,GAAG,CAAC;IAkFxE,OAAO,CAAC,WAAW;IAiCnB;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAYxB;;OAEG;IACH,OAAO,CAAC,iBAAiB;CAG1B"}
@@ -69,6 +69,7 @@ let OperlogInterceptor = OperlogInterceptor_1 = class OperlogInterceptor {
69
69
  const method = request.method;
70
70
  const userAgent = request.get('user-agent') || '';
71
71
  const requestParams = this.getRequestParams(request);
72
+ const headers = this.getRequestHeaders(request);
72
73
  const operLog = {
73
74
  title: this.options.name,
74
75
  method: controllerClass + '.' + handler.name,
@@ -78,6 +79,7 @@ let OperlogInterceptor = OperlogInterceptor_1 = class OperlogInterceptor {
78
79
  org_id: ((_a = user === null || user === void 0 ? void 0 : user.orgId) === null || _a === void 0 ? void 0 : _a.toString()) || '',
79
80
  oper_url: url,
80
81
  oper_ip: clientIp,
82
+ headers: JSON.stringify(headers),
81
83
  oper_param: JSON.stringify(requestParams),
82
84
  json_result: '',
83
85
  status: 0,
@@ -140,6 +142,12 @@ let OperlogInterceptor = OperlogInterceptor_1 = class OperlogInterceptor {
140
142
  // 移除敏感信息
141
143
  return params;
142
144
  }
145
+ /**
146
+ * 获取请求头
147
+ */
148
+ getRequestHeaders(request) {
149
+ return { ...(request.headers || {}) };
150
+ }
143
151
  };
144
152
  exports.OperlogInterceptor = OperlogInterceptor;
145
153
  exports.OperlogInterceptor = OperlogInterceptor = OperlogInterceptor_1 = __decorate([
@@ -1 +1 @@
1
- {"version":3,"file":"redis.service.d.ts","sourceRoot":"","sources":["../../src/services/redis.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,YAAY,EACZ,eAAe,EAGhB,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAE/D,qBACa,gBACX,YAAW,YAAY,EAAE,YAAY,EAAE,eAAe;IASpD,OAAO,CAAC,QAAQ,CAAC,aAAa;IAPhC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAqC;IAC5D,OAAO,CAAC,WAAW,CAAoB;IACvC,OAAO,CAAC,aAAa,CAAS;IAC9B,OAAO,CAAC,SAAS,CAAkB;gBAIhB,aAAa,EAAE,mBAAmB;IAM/C,YAAY;IAIZ,UAAU;IA0CV,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC;IAYtC,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAW5D,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIrC,eAAe;CAMhB"}
1
+ {"version":3,"file":"redis.service.d.ts","sourceRoot":"","sources":["../../src/services/redis.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,YAAY,EACZ,eAAe,EAGhB,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAE/D,qBACa,gBACX,YAAW,YAAY,EAAE,YAAY,EAAE,eAAe;IASpD,OAAO,CAAC,QAAQ,CAAC,aAAa;IAPhC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAqC;IAC5D,OAAO,CAAC,WAAW,CAAoB;IACvC,OAAO,CAAC,aAAa,CAAS;IAC9B,OAAO,CAAC,SAAS,CAAkB;gBAIhB,aAAa,EAAE,mBAAmB;IAM/C,YAAY;IAIZ,UAAU;IAuCV,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC;IAYtC,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAW5D,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIrC,eAAe;CAMhB"}
@@ -34,7 +34,6 @@ let RedisServiceImpl = RedisServiceImpl_1 = class RedisServiceImpl {
34
34
  }
35
35
  async initialize() {
36
36
  if (!this.isEnabled) {
37
- this.logger.log('Redis service disabled (usePerms is not enabled)');
38
37
  return;
39
38
  }
40
39
  if (this.isInitialized) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@saihu/common",
3
- "version": "1.1.80",
3
+ "version": "1.1.81",
4
4
  "description": "Common utilities for NestJS applications",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",