mirror of
https://github.com/lejianwen/rustdesk-api.git
synced 2026-02-21 11:51:07 +00:00
Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b6bd9150d9 | ||
|
|
96e3e3bc86 | ||
|
|
41377f41bb | ||
|
|
fb744f81e2 | ||
|
|
750c3bcbcd | ||
|
|
d4015d7284 | ||
|
|
a9bf3fda73 | ||
|
|
7f467a4814 |
@@ -1056,7 +1056,7 @@ const docTemplateapi = `{
|
|||||||
"application/json"
|
"application/json"
|
||||||
],
|
],
|
||||||
"tags": [
|
"tags": [
|
||||||
"WEBCLIENT"
|
"WEBCLIENT_V2"
|
||||||
],
|
],
|
||||||
"summary": "服务配置",
|
"summary": "服务配置",
|
||||||
"responses": {
|
"responses": {
|
||||||
|
|||||||
@@ -1049,7 +1049,7 @@
|
|||||||
"application/json"
|
"application/json"
|
||||||
],
|
],
|
||||||
"tags": [
|
"tags": [
|
||||||
"WEBCLIENT"
|
"WEBCLIENT_V2"
|
||||||
],
|
],
|
||||||
"summary": "服务配置",
|
"summary": "服务配置",
|
||||||
"responses": {
|
"responses": {
|
||||||
|
|||||||
@@ -869,7 +869,7 @@ paths:
|
|||||||
- token: []
|
- token: []
|
||||||
summary: 服务配置
|
summary: 服务配置
|
||||||
tags:
|
tags:
|
||||||
- WEBCLIENT
|
- WEBCLIENT_V2
|
||||||
/shared-peer:
|
/shared-peer:
|
||||||
post:
|
post:
|
||||||
consumes:
|
consumes:
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 19 KiB |
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=6"></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=6";
|
||||||
scriptTag.type = "application/javascript";
|
scriptTag.type = "application/javascript";
|
||||||
document.body.append(scriptTag);
|
document.body.append(scriptTag);
|
||||||
}
|
}
|
||||||
|
|||||||
28095
resources/web2/js/dist/index.js
vendored
28095
resources/web2/js/dist/index.js
vendored
File diff suppressed because it is too large
Load Diff
28121
resources/web2/js/dist/lang.js
vendored
Normal file
28121
resources/web2/js/dist/lang.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
34
resources/web2/js/dist/ljw.js
vendored
34
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,8 +57,8 @@ 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(_ => {
|
||||||
|
|||||||
224452
resources/web2/main.dart.js
vendored
224452
resources/web2/main.dart.js
vendored
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user