v0.16.19: 修复日志面板清空、URL误传文件工具、网络工具超时、结果截断
This commit is contained in:
@@ -11,6 +11,13 @@ export function sendLog(level: 'info' | 'success' | 'warn' | 'error' | 'debug',
|
||||
mainWindow?.webContents.send('main:log', { level, message, detail });
|
||||
}
|
||||
|
||||
/** 检测字符串是否为 URL(http:// 或 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);
|
||||
|
||||
Reference in New Issue
Block a user