ZaiZai 1 年間 前
コミット
52efa99df2
2 ファイル変更15 行追加2 行削除
  1. 13 0
      src/App.vue
  2. 2 2
      src/config/index.json

+ 13 - 0
src/App.vue

@@ -1,6 +1,7 @@
 <template>
     <hc-app-config>
         <router-view />
+        <div class="absolute top-0 w-full text-center" @click="testClick">测试</div>
     </hc-app-config>
 </template>
 
@@ -25,6 +26,18 @@ watch(() => [
     setUserTheme(ThemeVal, ColorVal)
 })
 
+const testClick = () => {
+    navigator.usb.requestDevice({ filters: [{}] }).then(device => {
+        console.log(device)
+        // 设备已授权
+        navigator.usb.getDevices().then(devices => {
+            console.log(devices)
+        })
+    }).catch(error => {
+        console.error('设备选择失败', error)
+    })
+}
+
 nextTick(() => {
     window.$localModel = website.localModel
     setUserTheme(appStore.getThemeVal, appStore.getColor)

+ 2 - 2
src/config/index.json

@@ -1,10 +1,10 @@
 {
     "version": "20230607160059",
     "target1": "http://127.0.0.1:8090",
-    "target2": "http://39.108.216.210:8090",
+    "target": "http://39.108.216.210:8090",
     "target3": "http://192.168.0.125:8090",
     "target4": "http://183.247.216.148:28090",
-    "target": "http://192.168.0.196:8090",
+    "target5": "http://192.168.0.196:8090",
     "socket": "wss://measure.hczcxx.cn/websocket",
     "socket2": "ws://192.168.0.125:9527/websocket",
     "localModel": false,