ソースを参照

日志上报api 动态判断使用http还是https前缀

tangdehang 3 ヶ月 前
コミット
b0b3e7c95f
共有1 個のファイルを変更した5 個の追加2 個の削除を含む
  1. 5 2
      static/rtcEngine/js/logReport.js

+ 5 - 2
static/rtcEngine/js/logReport.js

@@ -3,7 +3,10 @@
  */
 
 export default class LogReport {
-  URL_API = 'http://www.androidscloud.com:8002';
+  URL_API = {
+    'http:': 'http://www.androidscloud.com:8002',
+    'https:': 'https://www.androidscloud.com:8003',
+  }
   URL_SWITCH = '/api/public/v5/log/card/getLinkLogReportSwitch'; // 日志开关查询接口地址
   URL_ADDRESS = '/api/public/v5/log/card/reportCardLinkLog';  // 日志上报地址
   
@@ -179,7 +182,7 @@ export default class LogReport {
   * }
   */ 
   getLinkLogReportSwitch() {
-    return this.$Request.get(this.URL_API + this.URL_SWITCH);
+    return this.$Request.get(this.URL_API[location.protocol] + this.URL_SWITCH);
   }
 
   // 采集日志, 等待日志收集到一定数量或一定时间后再上报