From e1b082e9d75efb06da4132c70f5af87f1250fe08 Mon Sep 17 00:00:00 2001 From: denggaofeng <1139968554@qq.com> Date: Fri, 17 Apr 2026 14:26:26 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=A4=9A=E4=BD=99=E6=B3=A8?= =?UTF-8?q?=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.vue | 16 ---------------- src/api/index.ts | 26 +------------------------- src/types/index.ts | 11 ----------- 3 files changed, 1 insertion(+), 52 deletions(-) diff --git a/src/App.vue b/src/App.vue index 7a989a3..72a6678 100644 --- a/src/App.vue +++ b/src/App.vue @@ -61,22 +61,6 @@ declare const mqtt: any const selectedDeviceId = ref('') const deviceList = ref([]) -// const config = reactive({ -// serverIp: '118.145.200.78', -// getSources: ':3000/ks/source', -// subscribe: ':3000/stream/live/subscribe', -// resultTopic: 'ks/video_detection', -// streamInfoTopic: 'ks/stream_local', -// media_http_api: 3001, -// websocket: 8083, -// mqttAuth: ['work', 'Bjhmdys@202010'], -// accessKey: '6952564ceb712e2daeea7039', -// accessSecret: 'df717a60-85b7-4a63-b638-0aed4605d277', -// token: '', -// getToken: ':3000/ks/system/user/token', -// getTime: ':3000/ks/system/time', -// })】 - const config = reactive({ resultTopic: 'ks/video_detection', streamInfoTopic: 'ks/stream_local', diff --git a/src/api/index.ts b/src/api/index.ts index a9c0baa..32d328e 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -1,30 +1,6 @@ import type { GlobalConfig, SourceItem, MqttServerInfo, DeviceItem } from '../types' -// import { generateSignature, generateRandomString } from '../utils/signature' -// eslint-disable-next-line @typescript-eslint/no-unused-vars + export function createApis() { - // const baseUrl = () => `http://${config.serverIp}` - // const authHeader = () => ({ Authorization: `Bearer ${config.token}` }) - - // async function request(url: string, headers?: Record): Promise { - // const res = await fetch(url, { headers: { ...authHeader(), ...headers } }) - // if (!res.ok) throw new Error(`HTTP ${res.status}`) - // return res.json() - // } - - // async function getTimestamp(): Promise<{ data: number }> { - // return request(`${baseUrl()}${config.getTime}`) - // } - - // async function getToken(): Promise<{ error_code: number; data: string }> { - // const timestampRes = await getTimestamp() - // const timestamp = timestampRes.data - // const nonce = generateRandomString(10) - // const signature = generateSignature(config.accessKey, config.accessSecret, timestamp, nonce) - // const url = `${baseUrl()}${config.getToken}?signature=${signature}&ak=${config.accessKey}×tamp=${timestamp}&nonce=${nonce}` - // const res = await fetch(url) - // return res.json() - // } - async function getSources(deviceId:string): Promise { const res = await window.HybridWebView.InvokeDotNet('GetSourceListAsync', [deviceId]); console.log(res); diff --git a/src/types/index.ts b/src/types/index.ts index 8a2b8f4..5f904dc 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -1,17 +1,6 @@ export interface GlobalConfig { - // serverIp: string - // getSources: string - // subscribe: string resultTopic: string streamInfoTopic: string - // media_http_api: number - // websocket: number - // mqttAuth: [string, string] - // accessKey: string - // accessSecret: string - // token: string - // getToken: string - // getTime: string } export interface AlgInfo {