@be-link/shield-for-tcb-node-sdk 0.0.6 → 0.1.0
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/modules/BaseService.d.ts
CHANGED
|
@@ -3,11 +3,11 @@ export default abstract class BaseService {
|
|
|
3
3
|
/** URL一级路径 */
|
|
4
4
|
protected abstract prefixUrl: string;
|
|
5
5
|
/** 子网域名 */
|
|
6
|
-
protected readonly natDevHost = "http://
|
|
7
|
-
protected readonly natProdHost = "";
|
|
6
|
+
protected readonly natDevHost = "http://shield:8090";
|
|
7
|
+
protected readonly natProdHost = "http://shield:8090";
|
|
8
8
|
/** 公网域名 */
|
|
9
|
-
protected readonly publicDevHost = "https://
|
|
10
|
-
protected readonly publicProdHost = "";
|
|
9
|
+
protected readonly publicDevHost = "https://ecommerce-dev.wejourney.top";
|
|
10
|
+
protected readonly publicProdHost = "https://ecommerce-release.wejourney.top";
|
|
11
11
|
constructor();
|
|
12
12
|
/** 获取API URL */
|
|
13
13
|
protected getApiUrl(func: Function): string;
|
package/modules/BaseService.js
CHANGED
|
@@ -8,11 +8,11 @@ const string_1 = require("../utils/string");
|
|
|
8
8
|
class BaseService {
|
|
9
9
|
constructor() {
|
|
10
10
|
/** 子网域名 */
|
|
11
|
-
this.natDevHost = 'http://
|
|
12
|
-
this.natProdHost = '';
|
|
11
|
+
this.natDevHost = 'http://shield:8090';
|
|
12
|
+
this.natProdHost = 'http://shield:8090';
|
|
13
13
|
/** 公网域名 */
|
|
14
|
-
this.publicDevHost = 'https://
|
|
15
|
-
this.publicProdHost = '';
|
|
14
|
+
this.publicDevHost = 'https://ecommerce-dev.wejourney.top';
|
|
15
|
+
this.publicProdHost = 'https://ecommerce-release.wejourney.top';
|
|
16
16
|
/** 如果是云函数环境, 默认走公网访问 */
|
|
17
17
|
this.isPublicEnv = (process.env.CONTAINER_ENV || 'SCF') === 'SCF';
|
|
18
18
|
}
|
|
@@ -12,7 +12,7 @@ export declare class ConfigService extends BaseService implements Service.Config
|
|
|
12
12
|
fetchConfig(req: Service.Request.QueryFetchConfig): Promise<any>;
|
|
13
13
|
fetchGlobalDynamicConfig(): Promise<Service.Response.IFetchGlobalDynamicConfigResponse>;
|
|
14
14
|
getCosTempSecret(): Promise<Service.Response.CosTempSecretResponse>;
|
|
15
|
-
fetchSystemTime(): Promise<
|
|
15
|
+
fetchSystemTime(): Promise<number>;
|
|
16
16
|
}
|
|
17
17
|
export declare const backendConfigService: ConfigService;
|
|
18
18
|
export declare const frontendConfigService: ConfigService;
|
|
@@ -9,7 +9,7 @@ const BaseService_1 = __importDefault(require("../BaseService"));
|
|
|
9
9
|
class ConfigService extends BaseService_1.default {
|
|
10
10
|
constructor(options) {
|
|
11
11
|
super();
|
|
12
|
-
this.prefixUrl = '/config';
|
|
12
|
+
this.prefixUrl = '/shield/config';
|
|
13
13
|
this.caller = options?.caller ?? 'backend';
|
|
14
14
|
}
|
|
15
15
|
get shouldSkipErrorHandling() {
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@be-link/shield-for-tcb-node-sdk",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.1.0",
|
|
4
4
|
"description": "ShieldForTCB Node.js SDK",
|
|
5
|
-
"main": "
|
|
6
|
-
"types": "
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"types": "index.d.ts",
|
|
7
7
|
"keywords": [
|
|
8
8
|
"shield",
|
|
9
9
|
"tcb",
|
package/utils/http.js
CHANGED
|
@@ -74,7 +74,7 @@ async function callApi(url, request, options) {
|
|
|
74
74
|
console.error(`shield-for-tcb 异常: ${axiosError.message}, requestId: ${requestId}`);
|
|
75
75
|
console.info('响应信息', data.message);
|
|
76
76
|
console.error('异常堆栈', JSON.stringify(error.stack));
|
|
77
|
-
throw
|
|
77
|
+
throw axiosError;
|
|
78
78
|
}
|
|
79
79
|
// 调用dns模块解析url
|
|
80
80
|
const dns = await Promise.resolve().then(() => __importStar(require('dns')));
|