A 增加跨平台通信桥接实现(CSharp/Tauri/WebMock)

A 新增全局类型定义文件(global.d.ts)
A 新增 WebPanel 组件及其集成到 Shell UI
A 新增 BridgeFactory 工厂类用于动态创建桥接实例
U 优化 CommandManager 组件使用新通信桥接逻辑
D 移除未使用的旧代码和配置(e.g., 命令相关的 JS 文件)
This commit is contained in:
jimmy committed 2025-05-10 16:19:28 +08:00
1 parent 709ca30f12
commit 71fb7e2db1
22 files changed
+641 -199

No files matched your search

@@ -1,27 +0,0 @@
<script setup lang="ts">
import CommandManager from '@/components/CommandManager.vue'
import type { CommandType } from '@/types/command'
const commands: CommandType[] = [
{
name: 'greet',
description: '查询exif信息',
params: [
{
name: 'name',
label: 'name',
type: 'text',
value: 'Vue',
placeholder: 'string'
}
],
result: null
}
]
</script>
<template>
<CommandManager :pro="commands"></CommandManager>
</template>
<style scoped></style>
@@ -1,25 +0,0 @@
<script setup lang="ts">
import CommandManager from '@/components/CommandManager.vue'
import type { CommandType } from '@/types/command'
const commands: CommandType[] = [
{
name: 'is_elevated_command',
description: '是否有管理员权限',
params: [],
result: null,
},
{
name: 'get_exe_directory_command',
description: '获取程序所在目录',
params: [],
result: null,
},
]
</script>
<template>
<CommandManager :pro="commands"></CommandManager>
</template>
<style scoped></style>
@@ -1,53 +1,50 @@
<script setup lang="ts">
import CommandManager from '@/components/CommandManager.vue'
import type { CommandType } from '@/types/command'
import {onMounted,onUnmounted} from 'vue'
import CSharpBridgeV2 from "@/correspond/CSharpBridgeV2"
const bridge = CSharpBridgeV2.getBridge()
bridge.listen("showMessage",(data) => {
console.log('11111111',data);
})
function func() {
console.log('点击anniu')
bridge.send('showMessage',{
title: "来自前端的问候",
content: "Hello C#!"
},(data) => {
console.log(data,'======');
console.log(window.externalFunctions.__BRIDGE_LISTEN__FUNCTIONS__);
})
}
const commands: CommandType[] = [
{
name: 'win_divert_command',
description: '显示所有网络连接信息',
params: [],
result: null,
},
{
name: 'monitor_network_with_windivert_command',
description: '使用WinDivert监控网络数据包',
params: [],
result: null,
},
{
name: 'recv_packet_command',
description: '安全接收数据包的辅助函数',
params: [],
result: null,
},
{
name: 'recv_packet_command1',
description: '外部包接口!',
params: [],
result: null,
},
{
name: 'get_all_tcp_info',
description: '获取所有 TCP 信息!',
params: [],
result: null,
},
{
name: 'get_more_info',
description: 'get_more_info',
name: 'showMessage',
description: '获取信息!!',
params: [
{
name: 'id',
label: 'id',
name: 'title',
label: '标题',
type: 'text',
value: 'Vue',
placeholder: 'text'
}
},{
name: 'content',
label: '标题',
type: 'text',
value: 'Hello C#!',
placeholder: 'text'
},
],
result: null,
},
]
</script>
<template>