lejianwen 1 год назад
Родитель
Сommit
7f467a4814
4 измененных файлов с 81195 добавлено и 80982 удалено
  1. 2 2
      resources/web2/index.html
  2. 1 1
      resources/web2/js/dist/index.js
  3. 17 15
      resources/web2/js/dist/ljw.js
  4. 81175 80964
      resources/web2/main.dart.js

+ 2 - 2
resources/web2/index.html

@@ -32,7 +32,7 @@
32
     <title>RustDesk</title>
32
     <title>RustDesk</title>
33
     <script src="/webclient-config/index.js"></script>
33
     <script src="/webclient-config/index.js"></script>
34
     <link rel="manifest" href="manifest.json" />
34
     <link rel="manifest" href="manifest.json" />
35
-    <script type="module" crossorigin src="js/dist/index.js?v=4"></script>
35
+    <script type="module" crossorigin src="js/dist/index.js?v=5"></script>
36
     <link rel="modulepreload" href="js/dist/vendor.js?v=0b990c6e" />
36
     <link rel="modulepreload" href="js/dist/vendor.js?v=0b990c6e" />
37
     <style>
37
     <style>
38
       html,
38
       html,
@@ -259,7 +259,7 @@
259
         }
259
         }
260
         scriptLoaded = true;
260
         scriptLoaded = true;
261
         var scriptTag = document.createElement("script");
261
         var scriptTag = document.createElement("script");
262
-        scriptTag.src = "main.dart.js?v=6d46937e";
262
+        scriptTag.src = "main.dart.js?v=5";
263
         scriptTag.type = "application/javascript";
263
         scriptTag.type = "application/javascript";
264
         document.body.append(scriptTag);
264
         document.body.append(scriptTag);
265
       }
265
       }

+ 1 - 1
resources/web2/js/dist/index.js

@@ -1,4 +1,4 @@
1
-import {getServerConf} from "./ljw.js?v=4"
1
+import {getServerConf} from "./ljw.js?v=5"
2
 import {F as $t, J as Yt, L as Re, l as P4, m as r, P as ua, s as Xt, z as H4} from "./vendor.js?v=0b990c6e";
2
 import {F as $t, J as Yt, L as Re, l as P4, m as r, P as ua, s as Xt, z as H4} from "./vendor.js?v=0b990c6e";
3
 
3
 
4
 var Zt = Object.defineProperty;
4
 var Zt = Object.defineProperty;

+ 17 - 15
resources/web2/js/dist/ljw.js

@@ -1,5 +1,6 @@
1
 window._gwen = {}
1
 window._gwen = {}
2
 window._gwen.kv = {}
2
 window._gwen.kv = {}
3
+const storage_prefix = 'wc-'
3
 const apiserver = localStorage.getItem('wc-api-server')
4
 const apiserver = localStorage.getItem('wc-api-server')
4
 
5
 
5
 function stringToUint8Array(str) {
6
 function stringToUint8Array(str) {
@@ -23,10 +24,10 @@ function getQueryVariable() {
23
 
24
 
24
 getQueryVariable()
25
 getQueryVariable()
25
 
26
 
26
-const id = window._gwen.kv.id || ''
27
+/*const id = window._gwen.kv.id || ''
27
 if (id) {
28
 if (id) {
28
-    localStorage.setItem('remote-id', id)
29
-}
29
+    localStorage.setItem(storage_prefix+'option:local:last_remote_id', id)
30
+}*/
30
 const share_token = window._gwen.kv.share_token || ''
31
 const share_token = window._gwen.kv.share_token || ''
31
 if (share_token) {
32
 if (share_token) {
32
     fetch(apiserver + "/api/shared-peer", {
33
     fetch(apiserver + "/api/shared-peer", {
@@ -37,14 +38,15 @@ if (share_token) {
37
         body: JSON.stringify({share_token})
38
         body: JSON.stringify({share_token})
38
     }).then(res => res.json()).then(res => {
39
     }).then(res => res.json()).then(res => {
39
         if (res.code === 0) {
40
         if (res.code === 0) {
40
-            localStorage.setItem('custom-rendezvous-server', res.data.id_server)
41
-            localStorage.setItem('key', res.data.key)
42
-            const peer = res.data.peer
43
-            localStorage.setItem('remote-id', peer.info.id)
44
-            peer.tmppwd = stringToUint8Array(window.atob(peer.tmppwd)).toString()
45
-            const oldPeers = JSON.parse(localStorage.getItem('peers')) || {}
46
-            oldPeers[peer.info.id] = peer
47
-            localStorage.setItem('peers', JSON.stringify(oldPeers))
41
+            localStorage.setItem(storage_prefix + 'custom-rendezvous-server', res.data.id_server)
42
+            localStorage.setItem(storage_prefix + 'key', res.data.key)
43
+            const peer = res.data.peer || {}
44
+            /*const s = {
45
+                id: peer.info.id,
46
+                password: peer.tmppwd,
47
+            }*/
48
+            //修改location
49
+            window.location.href = `/webclient2/#/${peer.info.id}?password=${peer.tmppwd}`
48
         }
50
         }
49
     })
51
     })
50
 }
52
 }
@@ -55,7 +57,7 @@ export function getServerConf(token) {
55
     if (!token) {
57
     if (!token) {
56
         return
58
         return
57
     }
59
     }
58
-    const prefix = 'wc-'
60
+
59
     console.log('getServerConf', token)
61
     console.log('getServerConf', token)
60
     if (fetching) {
62
     if (fetching) {
61
         return
63
         return
@@ -71,9 +73,9 @@ export function getServerConf(token) {
71
     ).then(res => res.json()).then(res => {
73
     ).then(res => res.json()).then(res => {
72
         fetching = false
74
         fetching = false
73
         if (res.code === 0) {
75
         if (res.code === 0) {
74
-            if (!localStorage.getItem(prefix + 'custom-rendezvous-server') || !localStorage.getItem('key')) {
75
-                localStorage.setItem(prefix + 'custom-rendezvous-server', res.data.id_server)
76
-                localStorage.setItem(prefix + 'key', res.data.key)
76
+            if (!localStorage.getItem(storage_prefix + 'custom-rendezvous-server') || !localStorage.getItem('key')) {
77
+                localStorage.setItem(storage_prefix + 'custom-rendezvous-server', res.data.id_server)
78
+                localStorage.setItem(storage_prefix + 'key', res.data.key)
77
             }
79
             }
78
         }
80
         }
79
     }).catch(_ => {
81
     }).catch(_ => {

Разница между файлами не показана из-за своего большого размера
+ 81175 - 80964
resources/web2/main.dart.js