v0.16.19: 修复日志面板清空、URL误传文件工具、网络工具超时、结果截断

This commit is contained in:
2026-08-02 19:09:29 +08:00
parent e140e735de
commit e4f83bd09a
13 changed files with 295 additions and 196 deletions
+7
View File
@@ -11,6 +11,13 @@ export function sendLog(level: 'info' | 'success' | 'warn' | 'error' | 'debug',
mainWindow?.webContents.send('main:log', { level, message, detail });
}
/** 检测字符串是否为 URLhttp:// 或 https:// */
export function isUrl(str: string): boolean {
if (typeof str !== 'string' || str.length < 8) return false;
const lower = str.toLowerCase().trim();
return lower.startsWith('http://') || lower.startsWith('https://');
}
/** 解析路径:相对路径基于工作空间目录 */
export function resolvePath(inputPath: string): string {
if (path.isAbsolute(inputPath)) return path.resolve(inputPath);