Skip to content

Commit 01cc135

Browse files
authored
Merge pull request #33 from netease-lcap/fix-20250527/callConnectorPath
fix callConnectorPath
2 parents 3f6289d + dff0f82 commit 01cc135

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

packages/basic/src/utils/create/index.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,13 +158,18 @@ function download(url) {
158158
}
159159

160160
function formatCallConnectorPath(path: string, connectionName: string): string {
161+
const sysPrefixPath = window.appInfo?.sysPrefixPath;
162+
if (sysPrefixPath) {
163+
path = path?.replace(sysPrefixPath, "");
164+
}
165+
161166
// /api/connectors/connector1/namespace1/getA
162167
const pathItemList = (path || '').split('/').filter((i) => i);
163168
if (pathItemList.length < 3) {
164169
throw Error('unexpected path when use CallConnector');
165170
}
166171
const [prefix1, prefix2, connectorName, ...rt] = pathItemList;
167-
return `/${prefix1}/${prefix2}/${connectorName}/${connectionName}/${rt.join('/')}`;
172+
return `${sysPrefixPath ? sysPrefixPath : ""}/${prefix1}/${prefix2}/${connectorName}/${connectionName}/${rt.join('/')}`;
168173
}
169174

170175
export function genBaseOptions(requestInfo) {

0 commit comments

Comments
 (0)