Browse Source

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

tangdehang 3 months ago
parent
commit
b0b3e7c95f
1 changed files with 5 additions and 2 deletions
  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);
   }
 
   // 采集日志, 等待日志收集到一定数量或一定时间后再上报