@zeewain/3d-avatar-sdk 1.2.2 → 1.2.3
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/index.es5.js
CHANGED
|
@@ -13250,6 +13250,7 @@ var ZEEAvatarSDKLib = (function (exports) {
|
|
|
13250
13250
|
/**
|
|
13251
13251
|
* 获取指定环境的配置
|
|
13252
13252
|
* @param env - 环境类型,默认为'dev'
|
|
13253
|
+
* @param withApiModule - 是否包含API模块路径
|
|
13253
13254
|
* @returns 返回对应环境的配置对象
|
|
13254
13255
|
* @example
|
|
13255
13256
|
* ```typescript
|
|
@@ -13257,17 +13258,17 @@ var ZEEAvatarSDKLib = (function (exports) {
|
|
|
13257
13258
|
* console.log(config.apiBaseUrl); // https://aiip.zeewain.com/api/dh-talker
|
|
13258
13259
|
* ```
|
|
13259
13260
|
*/
|
|
13260
|
-
function getEnvConfig(env,
|
|
13261
|
+
function getEnvConfig(env, withApiModule) {
|
|
13261
13262
|
if (env === void 0) {
|
|
13262
13263
|
env = 'dev';
|
|
13263
13264
|
}
|
|
13264
|
-
if (
|
|
13265
|
-
|
|
13265
|
+
if (withApiModule === void 0) {
|
|
13266
|
+
withApiModule = true;
|
|
13266
13267
|
}
|
|
13267
13268
|
var baseUrl = ENV_MAP[env];
|
|
13268
13269
|
if (baseUrl) {
|
|
13269
13270
|
return {
|
|
13270
|
-
apiBaseUrl: "".concat(baseUrl.apiBaseUrl).concat(
|
|
13271
|
+
apiBaseUrl: "".concat(baseUrl.apiBaseUrl).concat(withApiModule ? '/api' : '')
|
|
13271
13272
|
};
|
|
13272
13273
|
}
|
|
13273
13274
|
return null;
|
|
@@ -13340,20 +13341,20 @@ var ZEEAvatarSDKLib = (function (exports) {
|
|
|
13340
13341
|
};
|
|
13341
13342
|
/**
|
|
13342
13343
|
* 获取API基础URL
|
|
13343
|
-
* @param
|
|
13344
|
+
* @param withApiModule 是否包含模块路径
|
|
13344
13345
|
* @returns string API基础URL
|
|
13345
13346
|
* @description 根据当前环境配置获取API基础URL
|
|
13346
13347
|
*/
|
|
13347
|
-
ConfigManager.prototype.getApiBaseUrl = function (
|
|
13348
|
+
ConfigManager.prototype.getApiBaseUrl = function (withApiModule) {
|
|
13348
13349
|
var _a, _b, _c, _d;
|
|
13349
|
-
if (
|
|
13350
|
-
|
|
13350
|
+
if (withApiModule === void 0) {
|
|
13351
|
+
withApiModule = true;
|
|
13351
13352
|
}
|
|
13352
13353
|
if (((_a = this.config) === null || _a === void 0 ? void 0 : _a.env) === 'custom' && ((_b = this.config) === null || _b === void 0 ? void 0 : _b.apiUrl)) {
|
|
13353
13354
|
// 如果环境为自定义,则直接返回配置的API,无需添加模块路径
|
|
13354
|
-
return this.config.apiUrl;
|
|
13355
|
+
return "".concat(this.config.apiUrl).concat(withApiModule ? '/api' : '');
|
|
13355
13356
|
}
|
|
13356
|
-
return ((_d = getEnvConfig(((_c = this.config) === null || _c === void 0 ? void 0 : _c.env) || 'prod',
|
|
13357
|
+
return ((_d = getEnvConfig(((_c = this.config) === null || _c === void 0 ? void 0 : _c.env) || 'prod', withApiModule)) === null || _d === void 0 ? void 0 : _d.apiBaseUrl) || '';
|
|
13357
13358
|
};
|
|
13358
13359
|
/**
|
|
13359
13360
|
* 获取自定义API URL
|
package/dist/index.es5.umd.js
CHANGED
|
@@ -13253,6 +13253,7 @@
|
|
|
13253
13253
|
/**
|
|
13254
13254
|
* 获取指定环境的配置
|
|
13255
13255
|
* @param env - 环境类型,默认为'dev'
|
|
13256
|
+
* @param withApiModule - 是否包含API模块路径
|
|
13256
13257
|
* @returns 返回对应环境的配置对象
|
|
13257
13258
|
* @example
|
|
13258
13259
|
* ```typescript
|
|
@@ -13260,17 +13261,17 @@
|
|
|
13260
13261
|
* console.log(config.apiBaseUrl); // https://aiip.zeewain.com/api/dh-talker
|
|
13261
13262
|
* ```
|
|
13262
13263
|
*/
|
|
13263
|
-
function getEnvConfig(env,
|
|
13264
|
+
function getEnvConfig(env, withApiModule) {
|
|
13264
13265
|
if (env === void 0) {
|
|
13265
13266
|
env = 'dev';
|
|
13266
13267
|
}
|
|
13267
|
-
if (
|
|
13268
|
-
|
|
13268
|
+
if (withApiModule === void 0) {
|
|
13269
|
+
withApiModule = true;
|
|
13269
13270
|
}
|
|
13270
13271
|
var baseUrl = ENV_MAP[env];
|
|
13271
13272
|
if (baseUrl) {
|
|
13272
13273
|
return {
|
|
13273
|
-
apiBaseUrl: "".concat(baseUrl.apiBaseUrl).concat(
|
|
13274
|
+
apiBaseUrl: "".concat(baseUrl.apiBaseUrl).concat(withApiModule ? '/api' : '')
|
|
13274
13275
|
};
|
|
13275
13276
|
}
|
|
13276
13277
|
return null;
|
|
@@ -13343,20 +13344,20 @@
|
|
|
13343
13344
|
};
|
|
13344
13345
|
/**
|
|
13345
13346
|
* 获取API基础URL
|
|
13346
|
-
* @param
|
|
13347
|
+
* @param withApiModule 是否包含模块路径
|
|
13347
13348
|
* @returns string API基础URL
|
|
13348
13349
|
* @description 根据当前环境配置获取API基础URL
|
|
13349
13350
|
*/
|
|
13350
|
-
ConfigManager.prototype.getApiBaseUrl = function (
|
|
13351
|
+
ConfigManager.prototype.getApiBaseUrl = function (withApiModule) {
|
|
13351
13352
|
var _a, _b, _c, _d;
|
|
13352
|
-
if (
|
|
13353
|
-
|
|
13353
|
+
if (withApiModule === void 0) {
|
|
13354
|
+
withApiModule = true;
|
|
13354
13355
|
}
|
|
13355
13356
|
if (((_a = this.config) === null || _a === void 0 ? void 0 : _a.env) === 'custom' && ((_b = this.config) === null || _b === void 0 ? void 0 : _b.apiUrl)) {
|
|
13356
13357
|
// 如果环境为自定义,则直接返回配置的API,无需添加模块路径
|
|
13357
|
-
return this.config.apiUrl;
|
|
13358
|
+
return "".concat(this.config.apiUrl).concat(withApiModule ? '/api' : '');
|
|
13358
13359
|
}
|
|
13359
|
-
return ((_d = getEnvConfig(((_c = this.config) === null || _c === void 0 ? void 0 : _c.env) || 'prod',
|
|
13360
|
+
return ((_d = getEnvConfig(((_c = this.config) === null || _c === void 0 ? void 0 : _c.env) || 'prod', withApiModule)) === null || _d === void 0 ? void 0 : _d.apiBaseUrl) || '';
|
|
13360
13361
|
};
|
|
13361
13362
|
/**
|
|
13362
13363
|
* 获取自定义API URL
|
package/dist/index.esm.js
CHANGED
|
@@ -1019,6 +1019,7 @@ const ENV_MAP = {
|
|
|
1019
1019
|
/**
|
|
1020
1020
|
* 获取指定环境的配置
|
|
1021
1021
|
* @param env - 环境类型,默认为'dev'
|
|
1022
|
+
* @param withApiModule - 是否包含API模块路径
|
|
1022
1023
|
* @returns 返回对应环境的配置对象
|
|
1023
1024
|
* @example
|
|
1024
1025
|
* ```typescript
|
|
@@ -1026,11 +1027,11 @@ const ENV_MAP = {
|
|
|
1026
1027
|
* console.log(config.apiBaseUrl); // https://aiip.zeewain.com/api/dh-talker
|
|
1027
1028
|
* ```
|
|
1028
1029
|
*/
|
|
1029
|
-
function getEnvConfig(env = 'dev',
|
|
1030
|
+
function getEnvConfig(env = 'dev', withApiModule = true) {
|
|
1030
1031
|
const baseUrl = ENV_MAP[env];
|
|
1031
1032
|
if (baseUrl) {
|
|
1032
1033
|
return {
|
|
1033
|
-
apiBaseUrl: `${baseUrl.apiBaseUrl}${
|
|
1034
|
+
apiBaseUrl: `${baseUrl.apiBaseUrl}${withApiModule ? '/api' : ''}`
|
|
1034
1035
|
};
|
|
1035
1036
|
}
|
|
1036
1037
|
return null;
|
|
@@ -1100,17 +1101,17 @@ class ConfigManager {
|
|
|
1100
1101
|
}
|
|
1101
1102
|
/**
|
|
1102
1103
|
* 获取API基础URL
|
|
1103
|
-
* @param
|
|
1104
|
+
* @param withApiModule 是否包含模块路径
|
|
1104
1105
|
* @returns string API基础URL
|
|
1105
1106
|
* @description 根据当前环境配置获取API基础URL
|
|
1106
1107
|
*/
|
|
1107
|
-
getApiBaseUrl(
|
|
1108
|
+
getApiBaseUrl(withApiModule = true) {
|
|
1108
1109
|
var _a, _b, _c, _d;
|
|
1109
1110
|
if (((_a = this.config) === null || _a === void 0 ? void 0 : _a.env) === 'custom' && ((_b = this.config) === null || _b === void 0 ? void 0 : _b.apiUrl)) {
|
|
1110
1111
|
// 如果环境为自定义,则直接返回配置的API,无需添加模块路径
|
|
1111
|
-
return this.config.apiUrl
|
|
1112
|
+
return `${this.config.apiUrl}${withApiModule ? '/api' : ''}`;
|
|
1112
1113
|
}
|
|
1113
|
-
return ((_d = getEnvConfig(((_c = this.config) === null || _c === void 0 ? void 0 : _c.env) || 'prod',
|
|
1114
|
+
return ((_d = getEnvConfig(((_c = this.config) === null || _c === void 0 ? void 0 : _c.env) || 'prod', withApiModule)) === null || _d === void 0 ? void 0 : _d.apiBaseUrl) || '';
|
|
1114
1115
|
}
|
|
1115
1116
|
/**
|
|
1116
1117
|
* 获取自定义API URL
|
package/dist/index.umd.cjs
CHANGED
|
@@ -1025,6 +1025,7 @@
|
|
|
1025
1025
|
/**
|
|
1026
1026
|
* 获取指定环境的配置
|
|
1027
1027
|
* @param env - 环境类型,默认为'dev'
|
|
1028
|
+
* @param withApiModule - 是否包含API模块路径
|
|
1028
1029
|
* @returns 返回对应环境的配置对象
|
|
1029
1030
|
* @example
|
|
1030
1031
|
* ```typescript
|
|
@@ -1032,11 +1033,11 @@
|
|
|
1032
1033
|
* console.log(config.apiBaseUrl); // https://aiip.zeewain.com/api/dh-talker
|
|
1033
1034
|
* ```
|
|
1034
1035
|
*/
|
|
1035
|
-
function getEnvConfig(env = 'dev',
|
|
1036
|
+
function getEnvConfig(env = 'dev', withApiModule = true) {
|
|
1036
1037
|
const baseUrl = ENV_MAP[env];
|
|
1037
1038
|
if (baseUrl) {
|
|
1038
1039
|
return {
|
|
1039
|
-
apiBaseUrl: `${baseUrl.apiBaseUrl}${
|
|
1040
|
+
apiBaseUrl: `${baseUrl.apiBaseUrl}${withApiModule ? '/api' : ''}`
|
|
1040
1041
|
};
|
|
1041
1042
|
}
|
|
1042
1043
|
return null;
|
|
@@ -1106,17 +1107,17 @@
|
|
|
1106
1107
|
}
|
|
1107
1108
|
/**
|
|
1108
1109
|
* 获取API基础URL
|
|
1109
|
-
* @param
|
|
1110
|
+
* @param withApiModule 是否包含模块路径
|
|
1110
1111
|
* @returns string API基础URL
|
|
1111
1112
|
* @description 根据当前环境配置获取API基础URL
|
|
1112
1113
|
*/
|
|
1113
|
-
getApiBaseUrl(
|
|
1114
|
+
getApiBaseUrl(withApiModule = true) {
|
|
1114
1115
|
var _a, _b, _c, _d;
|
|
1115
1116
|
if (((_a = this.config) === null || _a === void 0 ? void 0 : _a.env) === 'custom' && ((_b = this.config) === null || _b === void 0 ? void 0 : _b.apiUrl)) {
|
|
1116
1117
|
// 如果环境为自定义,则直接返回配置的API,无需添加模块路径
|
|
1117
|
-
return this.config.apiUrl
|
|
1118
|
+
return `${this.config.apiUrl}${withApiModule ? '/api' : ''}`;
|
|
1118
1119
|
}
|
|
1119
|
-
return ((_d = getEnvConfig(((_c = this.config) === null || _c === void 0 ? void 0 : _c.env) || 'prod',
|
|
1120
|
+
return ((_d = getEnvConfig(((_c = this.config) === null || _c === void 0 ? void 0 : _c.env) || 'prod', withApiModule)) === null || _d === void 0 ? void 0 : _d.apiBaseUrl) || '';
|
|
1120
1121
|
}
|
|
1121
1122
|
/**
|
|
1122
1123
|
* 获取自定义API URL
|