feat:实现携带路径发送信息的优化
- 将路径通过doc包裹起来便于后端读取
This commit is contained in:
@ -408,7 +408,11 @@ export async function handleWebviewMessage(
|
||||
if (uris && uris.length > 0) {
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
const selectedFiles: Array<{ path: string; relativePath: string; size: number }> = [];
|
||||
const selectedFiles: Array<{
|
||||
name: string;
|
||||
absolutePath: string;
|
||||
size: number;
|
||||
}> = [];
|
||||
const MAX_FILE_SIZE = 10 * 1024 * 1024; // 10 MB
|
||||
const MAX_TOTAL_SIZE = 50 * 1024 * 1024; // 50 MB
|
||||
const MAX_FILES = 1000;
|
||||
@ -440,8 +444,8 @@ export async function handleWebviewMessage(
|
||||
}
|
||||
|
||||
selectedFiles.push({
|
||||
path: filePath,
|
||||
relativePath: vscode.workspace.asRelativePath(filePath),
|
||||
name: path.basename(filePath),
|
||||
absolutePath: filePath,
|
||||
size: stat.size,
|
||||
});
|
||||
totalSize += stat.size;
|
||||
|
||||
Reference in New Issue
Block a user