build(build): 📦 focus on updating rust and front-end dependencies

update document content
This commit is contained in:
Dawn
2025-11-08 13:13:02 +08:00
parent 78392e975b
commit 01bd5c0e0b
22 changed files with 1778 additions and 2040 deletions

View File

@@ -8,7 +8,6 @@
"1yib.rust-bundle",
"ms-vscode.vscode-typescript-next",
"biomejs.biome",
"github.vscode-github-actions",
"fill-labs.dependi",
"usernamehw.errorlens"
]

View File

@@ -95,6 +95,7 @@
| Linux | Ubuntu 22.0+ |
| iOS/iPadOS | iOS 9.0+, iPadOS 9.0+ |
| Android | Android 8.0+ |
| Web | ⚠Not currently supported (custom removal required) |
## 📝 Project Introduction
@@ -369,7 +370,7 @@ Execute **pnpm run commit** to invoke _git commit_ interaction, complete informa
| 2025-04-01 | **墨** | `¥88.88` | ![WeChat](https://img.shields.io/badge/WeChat-07C160?style=flat&logo=wechat&logoColor=white) |
| 2025-02-8 | **邓伟** | `¥88` | ![WeChat](https://img.shields.io/badge/WeChat-07C160?style=flat&logo=wechat&logoColor=white) |
| 2025-02-7 | **dennis** | `¥80` | ![Gitee](https://img.shields.io/badge/Gitee-C71D23?style=flat&logo=gitee&logoColor=white) |
| 2025-11-5 | **欢迎仪式** | `¥66` | ![WeChat](https://img.shields.io/badge/WeChat-07C160?style=flat&logo=wechat&logoColor=white) |
| 2025-11-5 | **匿名用户** | `¥66` | ![WeChat](https://img.shields.io/badge/WeChat-07C160?style=flat&logo=wechat&logoColor=white) |
| 2025-02-6 | **小二** | `¥62` | ![WeChat](https://img.shields.io/badge/WeChat-07C160?style=flat&logo=wechat&logoColor=white) |
| 2025-05-15 | **孤鸿影** | `¥56` | ![WeChat](https://img.shields.io/badge/WeChat-07C160?style=flat&logo=wechat&logoColor=white) |

View File

@@ -95,6 +95,7 @@
| Linux | Ubuntu 22.0+ |
| iOS/iPadOS | iOS 9.0+, iPadOS 9.0+ |
| Android | Android 8.0+ |
| Web | ⚠️暂不支持(需要自定义移除对桌面功能) |
## 📝 项目介绍
@@ -372,7 +373,7 @@ sudo xattr -r -d com.apple.quarantine /Applications/应用名称.app
| 2025-04-01 | **墨** | `¥88.88` | ![微信赞赏](https://img.shields.io/badge/微信赞赏-07C160?style=flat&logo=wechat&logoColor=white) |
| 2025-02-8 | **邓伟** | `¥88` | ![微信赞赏](https://img.shields.io/badge/微信赞赏-07C160?style=flat&logo=wechat&logoColor=white) |
| 2025-02-7 | **dennis** | `¥80` | ![Gitee赞赏](https://img.shields.io/badge/Gitee赞赏-C71D23?style=flat&logo=gitee&logoColor=white) |
| 2025-11-5 | **欢迎仪式** | `¥66` | ![微信赞赏](https://img.shields.io/badge/微信赞赏-07C160?style=flat&logo=wechat&logoColor=white) |
| 2025-11-5 | **匿名用户** | `¥66` | ![微信赞赏](https://img.shields.io/badge/微信赞赏-07C160?style=flat&logo=wechat&logoColor=white) |
| 2025-02-6 | **小二** | `¥62` | ![微信赞赏](https://img.shields.io/badge/微信赞赏-07C160?style=flat&logo=wechat&logoColor=white) |
| 2025-05-15 | **孤鸿影** | `¥56` | ![微信赞赏](https://img.shields.io/badge/微信赞赏-07C160?style=flat&logo=wechat&logoColor=white) |

20
package.json vendored
View File

@@ -122,20 +122,20 @@
"naive-ui": "^2.43.1",
"p-limit": "^7.2.0",
"pinia": "^3.0.3",
"pinia-plugin-persistedstate": "^4.5.0",
"pinia-plugin-persistedstate": "^4.7.1",
"pinia-shared-state": "^1.0.1",
"seemly": "^0.3.10",
"stream-markdown": "^0.0.8",
"stream-markdown": "^0.0.9",
"stream-monaco": "^0.0.2",
"tauri-plugin-mic-recorder-api": "^2.0.0",
"tauri-plugin-safe-area-insets": "^0.1.0",
"three": "^0.181.0",
"tlbs-map-vue": "^1.3.1",
"vant": "^4.9.21",
"vue": "^3.5.22",
"vue": "^3.5.24",
"vue-cropper": "1.1.4",
"vue-demi": "0.14.10",
"vue-renderer-markdown": "0.0.61-beta.7",
"vue-renderer-markdown": "0.0.61-beta.8",
"vue-router": "^4.6.3",
"vue-virtual-scroller": "2.0.0-beta.8"
},
@@ -147,9 +147,9 @@
"@inquirer/prompts": "^7.8.6",
"@release-it/bumper": "^6.0.1",
"@release-it/conventional-changelog": "8.0.2",
"@tauri-apps/cli": "2.9.1",
"@tauri-apps/cli": "2.9.3",
"@types/crypto-js": "^4.2.2",
"@types/node": "^24.6.2",
"@types/node": "^24.10.0",
"@types/three": "^0.181.0",
"@unocss/preset-wind3": "^66.5.4",
"@unocss/reset": "^66.5.4",
@@ -158,8 +158,8 @@
"@unocss/vite": "^66.5.4",
"@vitejs/plugin-vue": "^6.0.1",
"@vitejs/plugin-vue-jsx": "^5.1.1",
"@vitest/coverage-v8": "^3.2.4",
"@vitest/ui": "^3.2.4",
"@vitest/coverage-v8": "^4.0.8",
"@vitest/ui": "^4.0.8",
"@vue/test-utils": "^2.4.6",
"@vueuse/core": "^14.0.0",
"chalk": "^5.6.2",
@@ -175,9 +175,9 @@
"typescript": "^5.9.3",
"unplugin-auto-import": "^20.2.0",
"unplugin-vue-components": "^30.0.0",
"vite": "7.1.12",
"vite": "7.2.2",
"vite-plugin-vue-setup-extend": "^0.4.0",
"vitest": "^3.2.4",
"vitest": "^4.0.8",
"vue-tsc": "^3.1.3",
"web-vitals": "^5.1.0"
},

1439
pnpm-lock.yaml generated vendored

File diff suppressed because it is too large Load Diff

2209
src-tauri/Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -32,7 +32,7 @@ crate-type = ["staticlib", "cdylib", "rlib"]
[build-dependencies]
tauri-build = { version = "2.5.1", features = [] }
cc = "1.0"
cc = "1.2"
[dependencies]
# Tauri 官方依赖
@@ -62,32 +62,32 @@ tauri-plugin-opener = "2"
# tauri-plugin-devtools = "2"
tauri-plugin-log = { version = "2", features = ["colored"] }
tracing = "0.1"
tracing-subscriber = "0.3.0"
tracing-subscriber = "0.3.20"
# Tauri 非官方依赖
tauri-plugin-mic-recorder = "2"
serde_json = "1"
sysinfo = "0.32.0"
async-walkdir = "2.0.0"
moka = { version = "0.12.10", features = ["future"] }
sysinfo = "0.37.2"
async-walkdir = "2.1.0"
moka = { version = "0.12.11", features = ["future"] }
serde = { version = "1", features = ["derive"] }
tokio = { version = "1.0.0", features = ["rt", "rt-multi-thread", "macros"] }
tokio = { version = "1.48.0", features = ["rt", "rt-multi-thread", "macros"] }
sea-orm = { version = "1.1.0", features = [ "sqlx-sqlite", "runtime-tokio-rustls", "macros", "debug-print" ] }
chrono = "0.4.41"
sea-orm = { version = "1.1.17", features = [ "sqlx-sqlite", "runtime-tokio-rustls", "macros", "debug-print" ] }
chrono = "0.4.42"
entity = { path = "entity" }
migration = { path = "migration" } # depends on your needs
anyhow = "1.0.98"
thiserror = "2.0.12"
config = { version = "0.15.11", default-features = false, features = ["yaml"] }
http = "0.2"
lazy_static = "1.4"
anyhow = "1.0.100"
thiserror = "2.0.17"
config = { version = "0.15.18", default-features = false, features = ["yaml"] }
http = "1.3.1"
lazy_static = "1.5"
mime_guess = "2.0.5"
base64 = "0.22.1"
rodio = "0.17.3"
rodio = "0.21.1"
image = { version = "0.25", features = ["jpeg", "png"] }
reqwest = { version = "0.11", default-features = false, features = [
reqwest = { version = "0.12", default-features = false, features = [
"json",
"socks",
"rustls-tls",
@@ -95,21 +95,21 @@ reqwest = { version = "0.11", default-features = false, features = [
"stream",
] }
futures = "0.3"
bytes = "1.5"
bytes = "1.10"
dotenv = "0.15.0"
pulldown-cmark = "0.12"
pulldown-cmark = "0.13"
# WebSocket 相关依赖
tokio-tungstenite = { version = "0.23", features = ["rustls-tls-webpki-roots"] }
tokio-tungstenite = { version = "0.28", features = ["rustls-tls-webpki-roots"] }
futures-util = "0.3"
url = "2.5"
uuid = { version = "1.10", features = ["v4"] }
uuid = { version = "1.18", features = ["v4"] }
# 移动端的依赖 (iOS 和 Android)
[target."cfg(any(target_os = \"android\", target_os = \"ios\"))".dependencies]
tauri-plugin-safe-area-insets = "0.1.0"
tauri-plugin-hula = { path="../tauri-plugin-hula"}
tauri-plugin-barcode-scanner = "2.4.0"
tauri-plugin-barcode-scanner = "2.4.2"
[target."cfg(target_os = \"ios\")".dependencies]
objc2 = "0.6.3"
@@ -125,20 +125,20 @@ ndk-context = "0.1"
# 不兼容移动端的依赖
[target."cfg(not(any(target_os = \"android\", target_os = \"ios\")))".dependencies]
tauri-plugin-autostart = "2"
tauri-plugin-single-instance = "2.3.3"
tauri-plugin-single-instance = "2.3.6"
tauri-plugin-updater = "2"
screenshots = "0.8.10"
# mac平台需要依赖
[target."cfg(target_os =\"macos\")".dependencies]
objc2-app-kit = "0.3.1"
objc2 = "0.6.2"
objc2-app-kit = "0.3.2"
objc2 = "0.6.3"
core-foundation = "0.10.1"
core-graphics = "0.25.0"
# windows平台需要依赖
[target."cfg(target_os = \"windows\")".dependencies]
windows = { version = "0.52", features = [
windows = { version = "0.62.2", features = [
"Win32_System_Com",
"Win32_UI_Shell",
"Win32_UI_Shell_Common",

View File

@@ -95,6 +95,7 @@
| Linux | Ubuntu 22.0+ |
| iOS/iPadOS | iOS 9.0+, iPadOS 9.0+ |
| Android | Android 8.0+ |
| Web | ⚠Not currently supported (custom removal required) |
## 📝 Project Introduction
@@ -369,7 +370,7 @@ Execute **pnpm run commit** to invoke _git commit_ interaction, complete informa
| 2025-04-01 | **墨** | `¥88.88` | ![WeChat](https://img.shields.io/badge/WeChat-07C160?style=flat&logo=wechat&logoColor=white) |
| 2025-02-8 | **邓伟** | `¥88` | ![WeChat](https://img.shields.io/badge/WeChat-07C160?style=flat&logo=wechat&logoColor=white) |
| 2025-02-7 | **dennis** | `¥80` | ![Gitee](https://img.shields.io/badge/Gitee-C71D23?style=flat&logo=gitee&logoColor=white) |
| 2025-11-5 | **欢迎仪式** | `¥66` | ![WeChat](https://img.shields.io/badge/WeChat-07C160?style=flat&logo=wechat&logoColor=white) |
| 2025-11-5 | **匿名用户** | `¥66` | ![WeChat](https://img.shields.io/badge/WeChat-07C160?style=flat&logo=wechat&logoColor=white) |
| 2025-02-6 | **小二** | `¥62` | ![WeChat](https://img.shields.io/badge/WeChat-07C160?style=flat&logo=wechat&logoColor=white) |
| 2025-05-15 | **孤鸿影** | `¥56` | ![WeChat](https://img.shields.io/badge/WeChat-07C160?style=flat&logo=wechat&logoColor=white) |

View File

@@ -95,6 +95,7 @@
| Linux | Ubuntu 22.0+ |
| iOS/iPadOS | iOS 9.0+, iPadOS 9.0+ |
| Android | Android 8.0+ |
| Web | ⚠️暂不支持(需要自定义移除对桌面功能) |
## 📝 项目介绍
@@ -372,7 +373,7 @@ sudo xattr -r -d com.apple.quarantine /Applications/应用名称.app
| 2025-04-01 | **墨** | `¥88.88` | ![微信赞赏](https://img.shields.io/badge/微信赞赏-07C160?style=flat&logo=wechat&logoColor=white) |
| 2025-02-8 | **邓伟** | `¥88` | ![微信赞赏](https://img.shields.io/badge/微信赞赏-07C160?style=flat&logo=wechat&logoColor=white) |
| 2025-02-7 | **dennis** | `¥80` | ![Gitee赞赏](https://img.shields.io/badge/Gitee赞赏-C71D23?style=flat&logo=gitee&logoColor=white) |
| 2025-11-5 | **欢迎仪式** | `¥66` | ![微信赞赏](https://img.shields.io/badge/微信赞赏-07C160?style=flat&logo=wechat&logoColor=white) |
| 2025-11-5 | **匿名用户** | `¥66` | ![微信赞赏](https://img.shields.io/badge/微信赞赏-07C160?style=flat&logo=wechat&logoColor=white) |
| 2025-02-6 | **小二** | `¥62` | ![微信赞赏](https://img.shields.io/badge/微信赞赏-07C160?style=flat&logo=wechat&logoColor=white) |
| 2025-05-15 | **孤鸿影** | `¥56` | ![微信赞赏](https://img.shields.io/badge/微信赞赏-07C160?style=flat&logo=wechat&logoColor=white) |

View File

@@ -4,6 +4,6 @@ version = "0.1.0"
edition = "2021"
[dependencies]
sea-orm = { version = "1.1.14" }
serde = { version = "1.0.219", features = ["derive"] }
serde_json = "1.0.141"
sea-orm = { version = "1.1.17" }
serde = { version = "1.0.228", features = ["derive"] }
serde_json = "1.0.145"

File diff suppressed because one or more lines are too long

View File

@@ -1400,10 +1400,10 @@
"markdownDescription": "This enables all index or metadata related commands without any pre-configured accessible paths."
},
{
"description": "An empty permission you can use to modify the global scope.",
"description": "An empty permission you can use to modify the global scope.\n\n## Example\n\n```json\n{\n \"identifier\": \"read-documents\",\n \"windows\": [\"main\"],\n \"permissions\": [\n \"fs:allow-read\",\n {\n \"identifier\": \"fs:scope\",\n \"allow\": [\n \"$APPDATA/documents/**/*\"\n ],\n \"deny\": [\n \"$APPDATA/documents/secret.txt\"\n ]\n }\n ]\n}\n```\n",
"type": "string",
"const": "fs:scope",
"markdownDescription": "An empty permission you can use to modify the global scope."
"markdownDescription": "An empty permission you can use to modify the global scope.\n\n## Example\n\n```json\n{\n \"identifier\": \"read-documents\",\n \"windows\": [\"main\"],\n \"permissions\": [\n \"fs:allow-read\",\n {\n \"identifier\": \"fs:scope\",\n \"allow\": [\n \"$APPDATA/documents/**/*\"\n ],\n \"deny\": [\n \"$APPDATA/documents/secret.txt\"\n ]\n }\n ]\n}\n```\n"
},
{
"description": "This scope permits access to all files and list content of top level directories in the application folders.",
@@ -5895,10 +5895,10 @@
"markdownDescription": "This enables all index or metadata related commands without any pre-configured accessible paths."
},
{
"description": "An empty permission you can use to modify the global scope.",
"description": "An empty permission you can use to modify the global scope.\n\n## Example\n\n```json\n{\n \"identifier\": \"read-documents\",\n \"windows\": [\"main\"],\n \"permissions\": [\n \"fs:allow-read\",\n {\n \"identifier\": \"fs:scope\",\n \"allow\": [\n \"$APPDATA/documents/**/*\"\n ],\n \"deny\": [\n \"$APPDATA/documents/secret.txt\"\n ]\n }\n ]\n}\n```\n",
"type": "string",
"const": "fs:scope",
"markdownDescription": "An empty permission you can use to modify the global scope."
"markdownDescription": "An empty permission you can use to modify the global scope.\n\n## Example\n\n```json\n{\n \"identifier\": \"read-documents\",\n \"windows\": [\"main\"],\n \"permissions\": [\n \"fs:allow-read\",\n {\n \"identifier\": \"fs:scope\",\n \"allow\": [\n \"$APPDATA/documents/**/*\"\n ],\n \"deny\": [\n \"$APPDATA/documents/secret.txt\"\n ]\n }\n ]\n}\n```\n"
},
{
"description": "This scope permits access to all files and list content of top level directories in the application folders.",

View File

@@ -1400,10 +1400,10 @@
"markdownDescription": "This enables all index or metadata related commands without any pre-configured accessible paths."
},
{
"description": "An empty permission you can use to modify the global scope.",
"description": "An empty permission you can use to modify the global scope.\n\n## Example\n\n```json\n{\n \"identifier\": \"read-documents\",\n \"windows\": [\"main\"],\n \"permissions\": [\n \"fs:allow-read\",\n {\n \"identifier\": \"fs:scope\",\n \"allow\": [\n \"$APPDATA/documents/**/*\"\n ],\n \"deny\": [\n \"$APPDATA/documents/secret.txt\"\n ]\n }\n ]\n}\n```\n",
"type": "string",
"const": "fs:scope",
"markdownDescription": "An empty permission you can use to modify the global scope."
"markdownDescription": "An empty permission you can use to modify the global scope.\n\n## Example\n\n```json\n{\n \"identifier\": \"read-documents\",\n \"windows\": [\"main\"],\n \"permissions\": [\n \"fs:allow-read\",\n {\n \"identifier\": \"fs:scope\",\n \"allow\": [\n \"$APPDATA/documents/**/*\"\n ],\n \"deny\": [\n \"$APPDATA/documents/secret.txt\"\n ]\n }\n ]\n}\n```\n"
},
{
"description": "This scope permits access to all files and list content of top level directories in the application folders.",
@@ -5895,10 +5895,10 @@
"markdownDescription": "This enables all index or metadata related commands without any pre-configured accessible paths."
},
{
"description": "An empty permission you can use to modify the global scope.",
"description": "An empty permission you can use to modify the global scope.\n\n## Example\n\n```json\n{\n \"identifier\": \"read-documents\",\n \"windows\": [\"main\"],\n \"permissions\": [\n \"fs:allow-read\",\n {\n \"identifier\": \"fs:scope\",\n \"allow\": [\n \"$APPDATA/documents/**/*\"\n ],\n \"deny\": [\n \"$APPDATA/documents/secret.txt\"\n ]\n }\n ]\n}\n```\n",
"type": "string",
"const": "fs:scope",
"markdownDescription": "An empty permission you can use to modify the global scope."
"markdownDescription": "An empty permission you can use to modify the global scope.\n\n## Example\n\n```json\n{\n \"identifier\": \"read-documents\",\n \"windows\": [\"main\"],\n \"permissions\": [\n \"fs:allow-read\",\n {\n \"identifier\": \"fs:scope\",\n \"allow\": [\n \"$APPDATA/documents/**/*\"\n ],\n \"deny\": [\n \"$APPDATA/documents/secret.txt\"\n ]\n }\n ]\n}\n```\n"
},
{
"description": "This scope permits access to all files and list content of top level directories in the application folders.",

View File

@@ -13,7 +13,7 @@ async-std = { version = "1", features = ["attributes", "tokio1"] }
entity.workspace = true
[dependencies.sea-orm-migration]
version = "1.1.0"
version = "1.1.17"
features = [
"sqlx-sqlite",
"runtime-tokio-rustls"

View File

@@ -1,8 +1,8 @@
use crate::im_request_client::ImUrl;
use crate::AppData;
use crate::im_request_client::ImUrl;
use futures::StreamExt;
use serde::{Deserialize, Serialize};
use tauri::{ipc::Channel, State};
use tauri::{State, ipc::Channel};
use tracing::{error, info};
/// SSE 流式数据事件

View File

@@ -108,7 +108,7 @@ pub fn audio(filename: &str, handle: AppHandle) -> Result<(), String> {
}
fn play_audio_internal(path: &str, handle: &AppHandle) -> Result<(), String> {
use rodio::{Decoder, Source};
use rodio::Decoder;
use std::fs::File;
use std::io::BufReader;
@@ -120,15 +120,11 @@ fn play_audio_internal(path: &str, handle: &AppHandle) -> Result<(), String> {
let audio = File::open(audio_path).map_err(|e| format!("打开音频文件失败: {}", e))?;
let file = BufReader::new(audio);
let (_stream, stream_handle) =
rodio::OutputStream::try_default().map_err(|e| format!("创建音频输出流失败: {}", e))?;
let stream = rodio::OutputStreamBuilder::open_default_stream()
.map_err(|e| format!("创建音频输出流失败: {}", e))?;
let source = Decoder::new(file).map_err(|e| format!("解码音频文件失败: {}", e))?;
stream_handle
.play_raw(source.convert_samples())
.map_err(|e| format!("播放音频失败: {}", e))?;
stream.mixer().add(source);
thread::sleep(Duration::from_millis(3000));
Ok(())
}
@@ -337,7 +333,8 @@ unsafe fn get_text_scale_from_registry() -> Result<f64, String> {
for (i, &subkey) in registry_paths.iter().enumerate() {
let mut hkey: HKEY = HKEY::default();
let result = unsafe { RegOpenKeyExW(HKEY_CURRENT_USER, subkey, 0, KEY_READ, &mut hkey) };
let result =
unsafe { RegOpenKeyExW(HKEY_CURRENT_USER, subkey, Some(0), KEY_READ, &mut hkey) };
if result.is_ok() {
let value_name = value_names[i];

View File

@@ -236,7 +236,7 @@ unsafe fn convert_hbitmap_to_image_data(
// 获取位图信息
let mut bitmap = BITMAP::default();
let result = GetObjectW(
hbitmap,
hbitmap.into(),
std::mem::size_of::<BITMAP>() as i32,
Some(&mut bitmap as *mut _ as *mut _),
);
@@ -252,7 +252,7 @@ unsafe fn convert_hbitmap_to_image_data(
let height = bitmap.bmHeight as u32;
// 创建设备上下文
let hdc = GetDC(HWND::default());
let hdc = GetDC(Some(HWND::default()));
if hdc.is_invalid() {
return Err(tauri::Error::Io(std::io::Error::new(
std::io::ErrorKind::Other,
@@ -260,9 +260,9 @@ unsafe fn convert_hbitmap_to_image_data(
)));
}
let mem_dc = CreateCompatibleDC(hdc);
let mem_dc = CreateCompatibleDC(Some(hdc));
if mem_dc.is_invalid() {
ReleaseDC(HWND::default(), hdc);
ReleaseDC(Some(HWND::default()), hdc);
return Err(tauri::Error::Io(std::io::Error::new(
std::io::ErrorKind::Other,
"创建兼容设备上下文失败",
@@ -270,7 +270,7 @@ unsafe fn convert_hbitmap_to_image_data(
}
// 选择位图到内存DC
let old_bitmap = SelectObject(mem_dc, hbitmap);
let old_bitmap = SelectObject(mem_dc, hbitmap.into());
// 准备位图信息头
let mut bmp_info = BITMAPINFO {
@@ -308,8 +308,8 @@ unsafe fn convert_hbitmap_to_image_data(
// 清理资源
SelectObject(mem_dc, old_bitmap);
DeleteDC(mem_dc);
ReleaseDC(HWND::default(), hdc);
let _ = DeleteDC(mem_dc);
ReleaseDC(Some(HWND::default()), hdc);
if result == 0 {
return Err(tauri::Error::Io(std::io::Error::new(
@@ -353,7 +353,7 @@ async fn generate_thumbnail_windows(
// 初始化 COM
unsafe {
CoInitializeEx(None, COINIT_APARTMENTTHREADED).map_err(|e| {
CoInitializeEx(None, COINIT_APARTMENTTHREADED).ok().map_err(|e| {
tauri::Error::Io(std::io::Error::new(
std::io::ErrorKind::Other,
format!("初始化 COM 失败: {:?}", e),

View File

@@ -27,4 +27,4 @@ pub async fn get_window_payload(label: String, once: bool) -> Option<serde_json:
let cache = payload_cache.get(&label);
cache.cloned()
}
}
}

View File

@@ -193,7 +193,8 @@ impl ImRequestClient {
let extra_headers = Some(vec![("Accept", "text/event-stream")]);
// 使用 build_request 构建请求
let request_builder = self.build_request(method.clone(), path, &body, &params, extra_headers);
let request_builder =
self.build_request(method.clone(), path, &body, &params, extra_headers);
// 发送请求
let response = request_builder.send().await?;

View File

@@ -1,3 +1,4 @@
use chrono;
use entity::{im_room, im_room_member};
use sea_orm::EntityTrait;
use sea_orm::IntoActiveModel;
@@ -7,7 +8,6 @@ use sea_orm::TransactionTrait;
use sea_orm::{ActiveModelTrait, Set};
use sea_orm::{ColumnTrait, DatabaseConnection, QueryFilter, QueryOrder};
use tracing::{debug, info};
use chrono;
use crate::pojo::common::{CursorPageParam, CursorPageResp};
use crate::{
@@ -285,8 +285,11 @@ pub async fn update_my_room_info(
Ok(())
} else {
// 如果没有找到记录,创建一个新记录(仅包含必要字段)
debug!("Room member record not found, creating new record for room_id: {}, uid: {}", room_id, uid);
debug!(
"Room member record not found, creating new record for room_id: {}, uid: {}",
room_id, uid
);
let new_member = im_room_member::ActiveModel {
id: Set(format!("{}_{}", room_id, uid)), // 使用 room_id + uid 作为主键
room_id: Set(Some(room_id.to_string())),
@@ -302,7 +305,7 @@ pub async fn update_my_room_info(
.insert(db)
.await
.map_err(|e| anyhow::anyhow!("Failed to insert new room member record: {}", e))?;
info!("Successfully created new room member record with my_name");
Ok(())
}

View File

@@ -181,7 +181,7 @@ impl WebSocketClient {
let sender = self.message_sender.read().await;
if let Some(sender) = sender.as_ref() {
let message = Message::Text(data.to_string());
let message = Message::Text(data.to_string().into());
sender.send(message.clone()).map_err(|e| {
anyhow::anyhow!("Failed to queue message for sending: {}", e)
})?;
@@ -459,7 +459,7 @@ impl WebSocketClient {
match msg {
Ok(Message::Text(text)) => {
Self::handle_message_static(
text,
text.to_string(),
&app_handle,
&last_pong_time,
&consecutive_failures,
@@ -467,7 +467,7 @@ impl WebSocketClient {
.await;
}
Ok(Message::Binary(data)) => {
if let Ok(text) = String::from_utf8(data) {
if let Ok(text) = String::from_utf8(data.to_vec()) {
Self::handle_message_static(
text,
&app_handle,
@@ -872,7 +872,7 @@ impl WebSocketClient {
if let Ok(json) = serde_json::to_value(&heartbeat_msg) {
let sender = message_sender.read().await;
if let Some(sender) = sender.as_ref() {
let message = Message::Text(json.to_string());
let message = Message::Text(json.to_string().into());
if let Err(e) = sender.send(message) {
error!("❌ Failed to send heartbeat: {}", e);
break;
@@ -959,7 +959,7 @@ impl WebSocketClient {
// 尝试发送每条消息
for message in messages_to_send {
let text_message = Message::Text(message.to_string());
let text_message = Message::Text(message.to_string().into());
if let Err(e) = sender.send(text_message) {
error!("❌ Failed to send pending message: {}", e);
failed_messages.push(message);

2
tsconfig.json vendored
View File

@@ -27,7 +27,7 @@
"@/*": ["./src/*"],
"#/*": ["./src/mobile/*"]
},
"types": ["vitest/globals", "@vue/test-utils"],
"types": ["vitest/globals", "@vue/test-utils", "node"],
"allowSyntheticDefaultImports": true,
"esModuleInterop": true
},