wgt-node-utils 1.2.42 → 1.2.44

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": "wgt-node-utils",
3
- "version": "1.2.42",
3
+ "version": "1.2.44",
4
4
  "description": "WGT工具类包",
5
5
  "main": "dist/bundle.js",
6
6
  "scripts": {
package/src/index.js CHANGED
@@ -384,8 +384,8 @@ class wgtNodeUtils {
384
384
  else if (err.config) {
385
385
  console.error(`============${new Date().toLocaleString()}===========`);
386
386
  console.error(`${message} [${err.config.method}]: ${err.config.url}`);
387
- console.error(`request: {params: ${JSON.stringify(err.config.params)}, data: ${ err.config.data ? JSON.stringify(err.config.data) : ''}}`);
388
- console.error(`response: ${JSON.stringify( this.safeStringify(err.response.data))}`);
387
+ // console.error(`request: {params: ${JSON.stringify(err.config.params)}, data: ${ err.config.data ? JSON.stringify(err.config.data) : ''}}`);
388
+ // console.error(`response: ${JSON.stringify( this.safeStringify(err.response.data))}`);
389
389
 
390
390
  this.sendFeiShu(feiShuContent, receive_id, useSendFeiShu);
391
391
 
@@ -753,7 +753,6 @@ class wgtNodeUtils {
753
753
  }
754
754
  /**
755
755
  * 获取SDK静态资源
756
- * @param {string} API_PATH - 项目API路径
757
756
  * @param {string} adsTagHref - SDK静态资源桶路径
758
757
  * @param {string} ENV - 环境变量
759
758
  * @param {object} option - 参数
@@ -762,24 +761,24 @@ class wgtNodeUtils {
762
761
  * @param {boolean} option.useSendFeiShu - 是否需要发送飞书
763
762
  * @returns {string} - SDK JS字符串
764
763
  */
765
- getSdkF2eFiles = async(API_PATH, adsTagHref, ENV, option) => {
764
+ getSdkF2eFiles = async(adsTagHref, ENV, option) => {
766
765
  const {
767
766
  components = '容器名称',
768
767
  receive_id = 'oc_aba13955509035daa7a799f30b1b3341',
769
768
  useSendFeiShu = false,
770
769
  } = option;
771
770
 
772
- // 生产环境使用API_PATH,其他环境使用adsTagHref
773
- const sdkFilesPath = ENV === 'prod' ? `${API_PATH}/sdk?kaimen=08E28C7EEED6A1B3F9A80154D75A150B` : adsTagHref;
771
+ // // 生产环境使用API_PATH,其他环境使用adsTagHref
772
+ // const sdkFilesPath = ENV === 'prod' ? `${API_PATH}/sdk?kaimen=08E28C7EEED6A1B3F9A80154D75A150B` : adsTagHref;
774
773
  // 飞书内容
775
774
  const feiShuContent = `{"text":"<b>前端容器node报错</b>\\ncomponent: ${components}\\nenv: ${ENV}\\nmesssage: SDK获取失败"}`;
776
775
 
777
776
  try {
778
- const res = await axios.get(sdkFilesPath);
777
+ const res = await axios.get(adsTagHref);
779
778
  return res.data;
780
779
  } catch (primaryError) {
781
780
  this.sendFeiShu(feiShuContent, receive_id, useSendFeiShu)
782
- console.log(`从主路径获取 SDK 失败: ${sdkFilesPath}`, primaryError);
781
+ console.log(`从主路径获取 SDK 失败: ${adsTagHref}`, primaryError);
783
782
  const fallbackRes = await axios.get(adsTagHref);
784
783
  return fallbackRes.data;
785
784
  }
@@ -827,6 +826,8 @@ class wgtNodeUtils {
827
826
  siteData = res.data && res.data.data && res.data.data;
828
827
  } else if (type === 'novel') {
829
828
  siteData = res.data && res.data.data && res.data.data.split(',').map(item => item.trim()).filter(item => item !== '');
829
+ } else if (type === 'game') {
830
+ siteData = res.data && res.data.data && res.data.data.split(',').map(item => item.trim()).filter(item => item !== '');
830
831
  }
831
832
  // 如果未获取到数据,使用en做为默认数据
832
833
  if (!siteData) {