mirror of
https://github.com/lejianwen/rustdesk-api.git
synced 2026-02-17 19:52:30 +00:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7f467a4814 |
4
resources/web2/index.html
vendored
4
resources/web2/index.html
vendored
@@ -32,7 +32,7 @@
|
|||||||
<title>RustDesk</title>
|
<title>RustDesk</title>
|
||||||
<script src="/webclient-config/index.js"></script>
|
<script src="/webclient-config/index.js"></script>
|
||||||
<link rel="manifest" href="manifest.json" />
|
<link rel="manifest" href="manifest.json" />
|
||||||
<script type="module" crossorigin src="js/dist/index.js?v=4"></script>
|
<script type="module" crossorigin src="js/dist/index.js?v=5"></script>
|
||||||
<link rel="modulepreload" href="js/dist/vendor.js?v=0b990c6e" />
|
<link rel="modulepreload" href="js/dist/vendor.js?v=0b990c6e" />
|
||||||
<style>
|
<style>
|
||||||
html,
|
html,
|
||||||
@@ -259,7 +259,7 @@
|
|||||||
}
|
}
|
||||||
scriptLoaded = true;
|
scriptLoaded = true;
|
||||||
var scriptTag = document.createElement("script");
|
var scriptTag = document.createElement("script");
|
||||||
scriptTag.src = "main.dart.js?v=6d46937e";
|
scriptTag.src = "main.dart.js?v=5";
|
||||||
scriptTag.type = "application/javascript";
|
scriptTag.type = "application/javascript";
|
||||||
document.body.append(scriptTag);
|
document.body.append(scriptTag);
|
||||||
}
|
}
|
||||||
|
|||||||
2
resources/web2/js/dist/index.js
vendored
2
resources/web2/js/dist/index.js
vendored
@@ -1,4 +1,4 @@
|
|||||||
import {getServerConf} from "./ljw.js?v=4"
|
import {getServerConf} from "./ljw.js?v=5"
|
||||||
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";
|
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";
|
||||||
|
|
||||||
var Zt = Object.defineProperty;
|
var Zt = Object.defineProperty;
|
||||||
|
|||||||
32
resources/web2/js/dist/ljw.js
vendored
32
resources/web2/js/dist/ljw.js
vendored
@@ -1,5 +1,6 @@
|
|||||||
window._gwen = {}
|
window._gwen = {}
|
||||||
window._gwen.kv = {}
|
window._gwen.kv = {}
|
||||||
|
const storage_prefix = 'wc-'
|
||||||
const apiserver = localStorage.getItem('wc-api-server')
|
const apiserver = localStorage.getItem('wc-api-server')
|
||||||
|
|
||||||
function stringToUint8Array(str) {
|
function stringToUint8Array(str) {
|
||||||
@@ -23,10 +24,10 @@ function getQueryVariable() {
|
|||||||
|
|
||||||
getQueryVariable()
|
getQueryVariable()
|
||||||
|
|
||||||
const id = window._gwen.kv.id || ''
|
/*const id = window._gwen.kv.id || ''
|
||||||
if (id) {
|
if (id) {
|
||||||
localStorage.setItem('remote-id', id)
|
localStorage.setItem(storage_prefix+'option:local:last_remote_id', id)
|
||||||
}
|
}*/
|
||||||
const share_token = window._gwen.kv.share_token || ''
|
const share_token = window._gwen.kv.share_token || ''
|
||||||
if (share_token) {
|
if (share_token) {
|
||||||
fetch(apiserver + "/api/shared-peer", {
|
fetch(apiserver + "/api/shared-peer", {
|
||||||
@@ -37,14 +38,15 @@ if (share_token) {
|
|||||||
body: JSON.stringify({share_token})
|
body: JSON.stringify({share_token})
|
||||||
}).then(res => res.json()).then(res => {
|
}).then(res => res.json()).then(res => {
|
||||||
if (res.code === 0) {
|
if (res.code === 0) {
|
||||||
localStorage.setItem('custom-rendezvous-server', res.data.id_server)
|
localStorage.setItem(storage_prefix + 'custom-rendezvous-server', res.data.id_server)
|
||||||
localStorage.setItem('key', res.data.key)
|
localStorage.setItem(storage_prefix + 'key', res.data.key)
|
||||||
const peer = res.data.peer
|
const peer = res.data.peer || {}
|
||||||
localStorage.setItem('remote-id', peer.info.id)
|
/*const s = {
|
||||||
peer.tmppwd = stringToUint8Array(window.atob(peer.tmppwd)).toString()
|
id: peer.info.id,
|
||||||
const oldPeers = JSON.parse(localStorage.getItem('peers')) || {}
|
password: peer.tmppwd,
|
||||||
oldPeers[peer.info.id] = peer
|
}*/
|
||||||
localStorage.setItem('peers', JSON.stringify(oldPeers))
|
//修改location
|
||||||
|
window.location.href = `/webclient2/#/${peer.info.id}?password=${peer.tmppwd}`
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -55,7 +57,7 @@ export function getServerConf(token) {
|
|||||||
if (!token) {
|
if (!token) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
const prefix = 'wc-'
|
|
||||||
console.log('getServerConf', token)
|
console.log('getServerConf', token)
|
||||||
if (fetching) {
|
if (fetching) {
|
||||||
return
|
return
|
||||||
@@ -71,9 +73,9 @@ export function getServerConf(token) {
|
|||||||
).then(res => res.json()).then(res => {
|
).then(res => res.json()).then(res => {
|
||||||
fetching = false
|
fetching = false
|
||||||
if (res.code === 0) {
|
if (res.code === 0) {
|
||||||
if (!localStorage.getItem(prefix + 'custom-rendezvous-server') || !localStorage.getItem('key')) {
|
if (!localStorage.getItem(storage_prefix + 'custom-rendezvous-server') || !localStorage.getItem('key')) {
|
||||||
localStorage.setItem(prefix + 'custom-rendezvous-server', res.data.id_server)
|
localStorage.setItem(storage_prefix + 'custom-rendezvous-server', res.data.id_server)
|
||||||
localStorage.setItem(prefix + 'key', res.data.key)
|
localStorage.setItem(storage_prefix + 'key', res.data.key)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}).catch(_ => {
|
}).catch(_ => {
|
||||||
|
|||||||
164421
resources/web2/main.dart.js
vendored
164421
resources/web2/main.dart.js
vendored
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user