skyeye-svc-common-utils 1.0.26 → 1.0.27

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "skyeye-svc-common-utils",
3
- "version": "1.0.26",
3
+ "version": "1.0.27",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -57,7 +57,7 @@
57
57
  "node-fetch": "^2.6.0",
58
58
  "nyc": "^15.1.0",
59
59
  "rotating-file-stream": "^1.4.6",
60
- "skyeye-common-const": "1.0.14",
60
+ "skyeye-common-const": "1.0.15",
61
61
  "swagger-jsdoc": "^3.5.0",
62
62
  "swagger-ui-express": "^4.1.3",
63
63
  "ts-node": "^9.0.0",
@@ -25,9 +25,11 @@ export async function sendInternalHttpRequest(userInfo:UserInfo, client: string,
25
25
  const internalClient = await getInternalClient(client)
26
26
  const url = internalClient + endpoint;
27
27
  let headers:any = jsonContentTypeHeaders();
28
- userInfo = await userInfoSimplifier(userInfo, select)
29
- let token: string = `${commonAppConst.httpHeader.BEARER} ${await generateJWT(userInfo)}`;
30
- headers[commonAppConst.httpHeader.AUTHORIZATION] = token;
28
+ if(userInfo){
29
+ userInfo = await userInfoSimplifier(userInfo, select)
30
+ let token: string = `${commonAppConst.httpHeader.BEARER} ${await generateJWT(userInfo)}`;
31
+ headers[commonAppConst.httpHeader.AUTHORIZATION] = token;
32
+ }
31
33
  return httpRequest(method, url, data, headers).then(response => {
32
34
  return response.json()
33
35
  })