@be-link/ecs-cli-nodejs 0.0.48 → 0.0.50
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/ecs/http.js +8 -0
- package/ecs/modules/service.d.ts +2 -2
- package/ecs/modules/service.js +2 -2
- package/package.json +1 -1
package/ecs/http.js
CHANGED
|
@@ -17,6 +17,8 @@ const axiosInstance = axios_1.default.create({
|
|
|
17
17
|
(0, axios_retry_1.default)(axiosInstance, {
|
|
18
18
|
retries: 1,
|
|
19
19
|
retryCondition(error) {
|
|
20
|
+
const config = error.config || {};
|
|
21
|
+
console.info(`errorURL${config.url}`);
|
|
20
22
|
console.info('errorMessage', error.message);
|
|
21
23
|
console.info('errorResponse', error.response ? error.response.data : null);
|
|
22
24
|
const isSocketHangUp = error.message.includes('socket hang up');
|
|
@@ -57,6 +59,12 @@ async function callApi(url, ...request) {
|
|
|
57
59
|
console.error(`ECS 异常[${requestId}]: ${axiosError.message}`);
|
|
58
60
|
console.info('响应信息', data.message);
|
|
59
61
|
console.error('异常堆栈', JSON.stringify(error.stack));
|
|
62
|
+
// 添加详细的异常信息日志
|
|
63
|
+
console.info(`ECS异常请求URL[${requestId}]: ${url}`);
|
|
64
|
+
console.info(`ECS异常请求参数[${requestId}]:`, JSON.stringify(request));
|
|
65
|
+
console.info(`ECS异常响应状态[${requestId}]: ${response.status}`);
|
|
66
|
+
console.info(`ECS异常响应数据[${requestId}]:`, JSON.stringify(response.data));
|
|
67
|
+
console.info(`ECS异常响应头[${requestId}]:`, JSON.stringify(response.headers));
|
|
60
68
|
throw new ErrorClass(data.message || 'ECS Error', response.status);
|
|
61
69
|
}
|
|
62
70
|
console.error(`ECS 未知异常[${requestId}]: ${axiosError.message}`, error.stack);
|
package/ecs/modules/service.d.ts
CHANGED
|
@@ -6,8 +6,8 @@ export default abstract class BaseService {
|
|
|
6
6
|
protected readonly natDevHost = "http://qgostaxv.ecs.nmkh74o4.rlwzae9d.com:8090";
|
|
7
7
|
protected readonly natProdHost = "http://bxbvjnca.ecs.cwl9ok0a.mk2u3r3l.com:8090";
|
|
8
8
|
/** 公网域名 */
|
|
9
|
-
protected readonly publicDevHost = "https://ecs-
|
|
10
|
-
protected readonly publicProdHost = "https://ecs
|
|
9
|
+
protected readonly publicDevHost = "https://ecs-dev.wejourney.top";
|
|
10
|
+
protected readonly publicProdHost = "https://ecs.wejourney.top";
|
|
11
11
|
constructor();
|
|
12
12
|
/** 获取API URL */
|
|
13
13
|
protected getApiUrl(func: Function): string;
|
package/ecs/modules/service.js
CHANGED
|
@@ -11,8 +11,8 @@ class BaseService {
|
|
|
11
11
|
this.natDevHost = 'http://qgostaxv.ecs.nmkh74o4.rlwzae9d.com:8090';
|
|
12
12
|
this.natProdHost = 'http://bxbvjnca.ecs.cwl9ok0a.mk2u3r3l.com:8090';
|
|
13
13
|
/** 公网域名 */
|
|
14
|
-
this.publicDevHost = 'https://ecs-
|
|
15
|
-
this.publicProdHost = 'https://ecs
|
|
14
|
+
this.publicDevHost = 'https://ecs-dev.wejourney.top';
|
|
15
|
+
this.publicProdHost = 'https://ecs.wejourney.top';
|
|
16
16
|
/** 如果是云函数环境, 默认走公网访问 */
|
|
17
17
|
this.isPublicEnv = (process.env.CONTAINER_ENV || 'SCF') === 'SCF';
|
|
18
18
|
}
|