We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 39ee00d commit 8c1e44dCopy full SHA for 8c1e44d
src/generator/serviceGenarator.ts
@@ -689,11 +689,14 @@ export default class ServiceGenerator {
689
if (response?.isAnonymous) {
690
const responseName = upperFirst(`${functionName}Response`);
691
// 使用正则表达式移除 response?.type 中包含 this.config.namespace 的部分,isAnonymous模式不需要 this.config.namespace 前缀
692
- const cleanType =
693
- response?.type?.replace(
694
- new RegExp(`${this.config.namespace}\\.`, 'g'),
695
- ''
696
- ) || '';
+ const cleanType = response?.type?.includes(
+ `${this.config.namespace}.`
+ )
+ ? response?.type?.replace(
+ new RegExp(`${this.config.namespace}\\.`, 'g'),
697
+ ''
698
699
+ : response?.type || '';
700
this.interfaceTPConfigs.push({
701
typeName: responseName,
702
type: cleanType,
0 commit comments