lejianwen 1 год назад
Родитель
Сommit
ad33afb154
3 измененных файлов с 3 добавлено и 10 удалено
  1. 1 3
      src/utils/auth.js
  2. 1 5
      src/utils/webclient.js
  3. 1 2
      src/views/address_book/components/shareByWebClient.vue

+ 1 - 3
src/utils/auth.js

@@ -1,5 +1,3 @@
1
-import {setToken as setWCToken} from '@/utils/webclient'
2
-
3
 const TokenKey = 'access_token'
1
 const TokenKey = 'access_token'
4
 const OidcCode = 'oidc_code'
2
 const OidcCode = 'oidc_code'
5
 const OidcCodeExpiry = 'oidc_code_expiry';
3
 const OidcCodeExpiry = 'oidc_code_expiry';
@@ -9,7 +7,7 @@ export function getToken () {
9
 }
7
 }
10
 
8
 
11
 export function setToken (token) {
9
 export function setToken (token) {
12
-  setWCToken(token)
10
+  localStorage.setItem(`wc-option:local:access_token`, token)
13
   return localStorage.setItem(TokenKey, token)
11
   return localStorage.setItem(TokenKey, token)
14
 }
12
 }
15
 
13
 

+ 1 - 5
src/utils/webclient.js

@@ -8,14 +8,9 @@ import { T } from '@/utils/i18n'
8
 
8
 
9
 const prefix = 'wc-'
9
 const prefix = 'wc-'
10
 
10
 
11
-export function setToken (token) {
12
-  localStorage.setItem(`${prefix}option:local:access_token`, token)
13
-}
14
-
15
 export const toWebClientLink = (row) => {
11
 export const toWebClientLink = (row) => {
16
   //v2
12
   //v2
17
   window.open(`${rustdeskConfig.value.api_server}/webclient2/#/${row.id}`)
13
   window.open(`${rustdeskConfig.value.api_server}/webclient2/#/${row.id}`)
18
-  // window.open(`${rustdeskConfig.value.api_server}/webclient/#/?id=${row.id}`)
19
 }
14
 }
20
 
15
 
21
 export const rustdeskConfig = ref({})
16
 export const rustdeskConfig = ref({})
@@ -36,6 +31,7 @@ export async function loadRustdeskConfig () {
36
   }
31
   }
37
 }
32
 }
38
 
33
 
34
+loadRustdeskConfig()
39
 
35
 
40
 export async function getPeerSlat (id) {
36
 export async function getPeerSlat (id) {
41
   const [addr, port] = rustdeskConfig.value.id_server.split(':')
37
   const [addr, port] = rustdeskConfig.value.id_server.split(':')

+ 1 - 2
src/views/address_book/components/shareByWebClient.vue

@@ -45,14 +45,13 @@
45
 <script setup>
45
 <script setup>
46
   import { T } from '@/utils/i18n'
46
   import { T } from '@/utils/i18n'
47
   import { computed, reactive, ref, watch } from 'vue'
47
   import { computed, reactive, ref, watch } from 'vue'
48
-  import { loadRustdeskConfig, getV2ShareUrl } from '@/utils/webclient'
48
+  import { getV2ShareUrl } from '@/utils/webclient'
49
   import * as sha256 from 'fast-sha256'
49
   import * as sha256 from 'fast-sha256'
50
   import { shareByWebClient } from '@/api/address_book'
50
   import { shareByWebClient } from '@/api/address_book'
51
   import { CopyDocument } from '@element-plus/icons'
51
   import { CopyDocument } from '@element-plus/icons'
52
   import { handleClipboard } from '@/utils/clipboard'
52
   import { handleClipboard } from '@/utils/clipboard'
53
   import { ElMessageBox } from 'element-plus'
53
   import { ElMessageBox } from 'element-plus'
54
 
54
 
55
-  loadRustdeskConfig()
56
   const props = defineProps({
55
   const props = defineProps({
57
     id: String,
56
     id: String,
58
     hash: String,
57
     hash: String,