Parcourir la source

websocket 使用 wss 协议

reghao il y a 9 mois
Parent
commit
934286fd88
3 fichiers modifiés avec 4 ajouts et 5 suppressions
  1. 1 2
      .env.development
  2. 1 1
      .env.production
  3. 2 2
      src/components/VideoPlayer.vue

+ 1 - 2
.env.development

@@ -1,2 +1 @@
-VUE_APP_SERVER_URL=//api.reghao.cn
-VUE_APP_OSS_URL=//oss.reghao.cn
+VUE_APP_SERVER_URL=//reghao.cn

+ 1 - 1
.env.production

@@ -1 +1 @@
-VUE_APP_SERVER_URL=//api.reghao.cn
+VUE_APP_SERVER_URL=//reghao.cn

+ 2 - 2
src/components/VideoPlayer.vue

@@ -25,7 +25,7 @@ export default {
       flvjs,
       DPlayer,
       danmaku: {
-        api: process.env.VUE_APP_SERVER_URL + '/api/comment/danmaku/',
+        api: process.env.VUE_APP_SERVER_URL + '/api/comment/danmaku/'
       },
       getUrl: true,
       userToken: null
@@ -47,7 +47,7 @@ export default {
         if (res.code === 0) {
           var sendEvent = false
           if (this.userToken != null) {
-            const wsUrl = 'ws:' + process.env.VUE_APP_SERVER_URL + '/ws/progress?token=' + this.userToken
+            const wsUrl = 'wss:' + process.env.VUE_APP_SERVER_URL + '/ws/progress?token=' + this.userToken
             this.wsClient = new SocketInstance(wsUrl)
             this.wsClient.connect()
             sendEvent = true