Browse Source

2020-06-07 19:19

zry 3 years ago
parent
commit
f47c93b413
1 changed files with 12 additions and 2 deletions
  1. 12 2
      TelwsView.vue

+ 12 - 2
TelwsView.vue

@@ -162,7 +162,13 @@ const ConnState = {
 };
 export default {
   name: "telws_view",
-  props: ["hideUrl", "defaultUrl", "autoConnect", "defaultBackground", "disableUrl"],
+  props: [
+    "hideUrl",
+    "defaultUrl",
+    "autoConnect",
+    "defaultBackground",
+    "disableUrl"
+  ],
   watch: {
     background(newVal, oldVal) {
       if (this.$refs.term.$term) {
@@ -378,7 +384,11 @@ export default {
         this.disconnect();
       }
       this.$refs.term.$term.clear();
-      this.connSM.url_prefix = this.telwsurl + "/";
+      if (this.telwsurl.charAt(this.telwsurl.length - 1) == "/") {
+        this.connSM.url_prefix = this.telwsurl;
+      } else {
+        this.connSM.url_prefix = this.telwsurl + "/";
+      }
       var turl = new URL(this.connSM.url_prefix);
       var schpre = "ws:";
       if (turl.protocol === "https:") {