up web client v2
This commit is contained in:
+1
-3
@@ -1,5 +1,3 @@
|
|||||||
import {setToken as setWCToken} from '@/utils/webclient'
|
|
||||||
|
|
||||||
const TokenKey = 'access_token'
|
const TokenKey = 'access_token'
|
||||||
const OidcCode = 'oidc_code'
|
const OidcCode = 'oidc_code'
|
||||||
const OidcCodeExpiry = 'oidc_code_expiry';
|
const OidcCodeExpiry = 'oidc_code_expiry';
|
||||||
@@ -9,7 +7,7 @@ export function getToken () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function setToken (token) {
|
export function setToken (token) {
|
||||||
setWCToken(token)
|
localStorage.setItem(`wc-option:local:access_token`, token)
|
||||||
return localStorage.setItem(TokenKey, token)
|
return localStorage.setItem(TokenKey, token)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,14 +8,9 @@ import { T } from '@/utils/i18n'
|
|||||||
|
|
||||||
const prefix = 'wc-'
|
const prefix = 'wc-'
|
||||||
|
|
||||||
export function setToken (token) {
|
|
||||||
localStorage.setItem(`${prefix}option:local:access_token`, token)
|
|
||||||
}
|
|
||||||
|
|
||||||
export const toWebClientLink = (row) => {
|
export const toWebClientLink = (row) => {
|
||||||
//v2
|
//v2
|
||||||
window.open(`${rustdeskConfig.value.api_server}/webclient2/#/${row.id}`)
|
window.open(`${rustdeskConfig.value.api_server}/webclient2/#/${row.id}`)
|
||||||
// window.open(`${rustdeskConfig.value.api_server}/webclient/#/?id=${row.id}`)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export const rustdeskConfig = ref({})
|
export const rustdeskConfig = ref({})
|
||||||
@@ -36,6 +31,7 @@ export async function loadRustdeskConfig () {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
loadRustdeskConfig()
|
||||||
|
|
||||||
export async function getPeerSlat (id) {
|
export async function getPeerSlat (id) {
|
||||||
const [addr, port] = rustdeskConfig.value.id_server.split(':')
|
const [addr, port] = rustdeskConfig.value.id_server.split(':')
|
||||||
|
|||||||
@@ -45,14 +45,13 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { T } from '@/utils/i18n'
|
import { T } from '@/utils/i18n'
|
||||||
import { computed, reactive, ref, watch } from 'vue'
|
import { computed, reactive, ref, watch } from 'vue'
|
||||||
import { loadRustdeskConfig, getV2ShareUrl } from '@/utils/webclient'
|
import { getV2ShareUrl } from '@/utils/webclient'
|
||||||
import * as sha256 from 'fast-sha256'
|
import * as sha256 from 'fast-sha256'
|
||||||
import { shareByWebClient } from '@/api/address_book'
|
import { shareByWebClient } from '@/api/address_book'
|
||||||
import { CopyDocument } from '@element-plus/icons'
|
import { CopyDocument } from '@element-plus/icons'
|
||||||
import { handleClipboard } from '@/utils/clipboard'
|
import { handleClipboard } from '@/utils/clipboard'
|
||||||
import { ElMessageBox } from 'element-plus'
|
import { ElMessageBox } from 'element-plus'
|
||||||
|
|
||||||
loadRustdeskConfig()
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
id: String,
|
id: String,
|
||||||
hash: String,
|
hash: String,
|
||||||
|
|||||||
Reference in New Issue
Block a user