Browse Source

Signed-off-by: caner <5658514@qq.com>

caner 3 years ago
parent
commit
5700f67c85
2 changed files with 17 additions and 35 deletions
  1. 0 25
      README.md
  2. 17 10
      src/App.vue

+ 0 - 25
README.md

@@ -2,28 +2,3 @@
 ```
 ```
 采用遥控手柄控制,为RC 幽灵90018车适配中...
 采用遥控手柄控制,为RC 幽灵90018车适配中...
 ```
 ```
-## 教程
-```
-1. 房间ID与车端ID需一致
-2. 可自行编译打包
-3. 可使用现成控制端:car.caner.top
-```
-## 编译
-```
-1. yarn
-2. yarn build (www文件即是打包后的)
-```
-
-## 注意
-```
-1. 遥控手柄自行连接电脑
-2. 左摇杆云台控制
-3. 右摇杆方向及车速控制
-4. A键是2档
-5. B键是1档
-6. R2是语音(按住说话)
-7. X3是静音
-8. Y2是鸣笛
-```
-## TODO:
-4. 电量采集优化(准确性)

+ 17 - 10
src/App.vue

@@ -75,7 +75,8 @@ export default {
   data() {
   data() {
     return {
     return {
       socket: null,
       socket: null,
-      HOST: "wss://car.caner.top",
+      // HOST: "wss://car.caner.top",
+      HOST:'ws://127.0.0.1:10086',
       Peer: null,
       Peer: null,
       isLogin: false,
       isLogin: false,
       error: "",
       error: "",
@@ -257,15 +258,21 @@ export default {
 
 
     // 登录
     // 登录
     login(data) {
     login(data) {
-      if (this.socket) {
-        this.socket.auth = {
-          roomID: data.roomID,
-          name: data.name,
-        };
-        this.socket.connect();
-      } else {
-        this.error = "服务器连接失败";
+      // if (this.socket) {
+      //   this.socket.auth = {
+      //     roomID: data.roomID,
+      //     name: data.name,
+      //   };
+      //   this.socket.connect();
+      // } else {
+      //   this.error = "服务器连接失败";
+      // }
+      const obj = {
+        roomID: data.roomID,
+        name: data.name
       }
       }
+      const socket = new WebSocket(this.HOST+'?test=123');
+      console.log(666,socket);
     },
     },
 
 
     // 关闭
     // 关闭
@@ -297,7 +304,7 @@ export default {
     },
     },
   },
   },
   mounted() {
   mounted() {
-    this.intSoketRtc(this.HOST);
+    // this.intSoketRtc(this.HOST);
   },
   },
   watch: {
   watch: {
     // 静音
     // 静音