Skip to content

Commit 98ad880

Browse files
author
姚嘉伦
committed
fix: 修复fileid解析
1 parent 148247f commit 98ad880

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/tools/get-dsl.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,13 @@ export class GetDslTool extends BaseTool {
4949
);
5050
}
5151

52-
let finalFileId = fileId;
52+
let finalFileId = this.normalizeFileId(fileId);
5353
let finalLayerId = layerId;
5454

5555
// If URL is provided, extract fileId and layerId from it
5656
if (shortLink) {
5757
const ids = await httpUtilInstance.extractIdsFromUrl(shortLink);
58-
finalFileId = ids.fileId;
58+
finalFileId = this.normalizeFileId(ids.fileId);
5959
finalLayerId = ids.layerId;
6060
}
6161

@@ -85,4 +85,10 @@ export class GetDslTool extends BaseTool {
8585
};
8686
}
8787
}
88+
89+
private normalizeFileId(fileId?: string) {
90+
if (!fileId) return fileId;
91+
return fileId.replace(/^file\//, "");
92+
}
93+
8894
}

0 commit comments

Comments
 (0)