feat(app): 添加 ASMR 和磁力链接功能模块

- 新增 asmr_bp 蓝图模块和 AsmrService 服务
- 新增 magnet_bp 蓝图模块和 MagnetService 服务
- 在应用初始化时注册新的蓝图模块
- 将 switch 语句替换为 if-elif 语句进行配置管理
- 在前端界面添加 ASMR 功能入口
- 增加 libtorrent 依赖包
- 修复字符串引号使用问题
- 增加文件重命名异常处理
- 扩展类型注解支持 Union 类型
- 增加请求超时时间到 30 秒
- 优化前端错误处理逻辑
This commit is contained in:
2026-06-01 18:43:06 +08:00
parent f7539a33b0
commit 6cbacab98b
13 changed files with 93 additions and 30 deletions
+15 -9
View File
@@ -2,25 +2,25 @@ import request from "../utils/request.ts"
type ResponseData = Promise<{ code: number, message: Array<never> }>
export function book_download():ResponseData {
export function book_download(): ResponseData {
return request({
url: "/book/download",
})
}
export function video_findDeduplication():ResponseData {
export function video_findDeduplication(): ResponseData {
return request({
url: "/video/findDeduplication",
})
}
export function video_deduplication():ResponseData {
export function video_deduplication(): ResponseData {
return request({
url: "/video/deduplication",
})
}
export function video_hasTorrent():ResponseData {
export function video_hasTorrent(): ResponseData {
return request({
url: "/video/hasTorrent",
})
@@ -32,31 +32,31 @@ export function file_rename(): ResponseData {
})
}
export function torrent_deduplication():ResponseData {
export function torrent_deduplication(): ResponseData {
return request({
url: "/torrent/deduplication",
})
}
export function image_export():ResponseData {
export function image_export(): ResponseData {
return request({
url: "/image/export",
})
}
export function image_hasTorrent():ResponseData {
export function image_hasTorrent(): ResponseData {
return request({
url: "/image/hasTorrent",
})
}
export function music_rename():ResponseData {
export function music_rename(): ResponseData {
return request({
url: "/music/rename",
})
}
export function test():ResponseData {
export function test(): ResponseData {
return request({
url: "/test",
})
@@ -67,3 +67,9 @@ export function torrent_statistics(): ResponseData {
url: "/torrent/statistics",
})
}
export function asmr(): ResponseData {
return request({
url: "/asmr/",
})
}
+1 -1
View File
@@ -25,7 +25,7 @@ axios.defaults.headers["Content-Type"] = "application/json; charset=UTF-8"
const service: AxiosInstance = axios.create({
baseURL: "http://192.168.1.32:5000/api/",
// baseURL: "/api",
timeout: 10000,
timeout: 30000,
})
service.interceptors.request.use((config: InternalAxiosRequestConfig) => {
+7 -2
View File
@@ -1,6 +1,7 @@
<script setup lang="ts">
import {ref, onUnmounted} from "vue";
import {
asmr,
file_rename,
music_rename,
image_hasTorrent,
@@ -38,7 +39,8 @@ const buttons = [
{id: 5, title: "判断视频是否有torrent", handle: video_hasTorrent},
{id: 6, title: "判断图片是否有torrent", handle: image_hasTorrent},
{id: 7, title: "音乐文件重命名", handle: music_rename},
{id: 8, title: "种子统计", handle: torrent_statistics}
{id: 8, title: "种子统计", handle: torrent_statistics},
{id: 9, title: "asmr", handle: asmr}
]
@@ -64,7 +66,10 @@ const handleClick = async (btnObj: BtnItem) => {
}))
messages.value.push({id: Date.now() + messages.value.length, text: '已完成'})
messages.value.reverse()
} finally {
} catch (e) {
console.log(e)
}
finally {
loading.value = false
}
}