diff --git a/docs/en/CLI.md b/docs/en/CLI.md index d381290508..491ebee401 100644 --- a/docs/en/CLI.md +++ b/docs/en/CLI.md @@ -298,7 +298,7 @@ abp generate-proxy -t [options] Examples: ````bash -abp generate-proxy -t ng +abp generate-proxy -t ng -url https://localhost:44302/ abp generate-proxy -t js -url https://localhost:44302/ abp generate-proxy -t csharp -url https://localhost:44302/ ```` @@ -312,12 +312,13 @@ abp generate-proxy -t csharp -url https://localhost:44302/ * `--api-name` or `-a`: The name of the API endpoint defined in the `/src/environments/environment.ts`. Default value: `default`. * `--source` or `-s`: Specifies the Angular project name to resolve the root namespace & API definition URL from. Default value: `defaultProject`. * `--target`: Specifies the Angular project name to place generated code in. Default value: `defaultProject`. + * `--url`: Specifies api definition url. Default value is API Name's url in environment file. * `--prompt` or `-p`: Asks the options from the command line prompt (for the unspecified options). * `js`: JavaScript. work in the `*.Web` project directory. There are some additional options for this client: * `--output` or `-o`: JavaScript file path or folder to place generated code in. * `--module` or `-m`: Specifies the name of the backend module you wish to generate proxies for. Default value: `app`. * `--working-directory` or `-wd`: Execution directory. For `csharp` and `js` client types. -* `--url` or `-u`: API definition URL from. For `csharp` and `js` client types. +* `--url` or `-u`: API definition URL from. > See the [Angular Service Proxies document](UI/Angular/Service-Proxies.md) for more. @@ -350,12 +351,13 @@ abp remove-proxy -t csharp --folder MyProxies/InnerFolder * `--api-name` or `-a`: The name of the API endpoint defined in the `/src/environments/environment.ts`. Default value: `default`. * `--source` or `-s`: Specifies the Angular project name to resolve the root namespace & API definition URL from. Default value: `defaultProject`. * `--target`: Specifies the Angular project name to place generated code in. Default value: `defaultProject`. + * `--url`: Specifies api definition url. Default value is API Name's url in environment file. * `--prompt` or `-p`: Asks the options from the command line prompt (for the unspecified options). * `js`: JavaScript. work in the `*.Web` project directory. There are some additional options for this client: * `--output` or `-o`: JavaScript file path or folder to place generated code in. * `--module` or `-m`: Specifies the name of the backend module you wish to generate proxies for. Default value: `app`. * `--working-directory` or `-wd`: Execution directory. For `csharp` and `js` client types. -* `--url` or `-u`: API definition URL from. For `csharp` and `js` client types. +* `--url` or `-u`: API definition URL from. > See the [Angular Service Proxies document](UI/Angular/Service-Proxies.md) for more. diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ServiceProxying/Angular/AngularServiceProxyGenerator.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ServiceProxying/Angular/AngularServiceProxyGenerator.cs index e6069981da..7e30a9a6bf 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ServiceProxying/Angular/AngularServiceProxyGenerator.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ServiceProxying/Angular/AngularServiceProxyGenerator.cs @@ -48,7 +48,7 @@ public class AngularServiceProxyGenerator : ServiceProxyGeneratorBase { const source = await resolveProject(host, params.source!); - const sourceUrl = getSourceUrl(host, source, apiName); + if (!sourceUrl) { + sourceUrl = getSourceUrl(host, source, apiName); + } return await getApiDefinition(sourceUrl); }; }