@@ -9,8 +9,8 @@ import { Args } from './Args';
99import {
1010 AXIOS_IMPORT_FILE ,
1111 AXIOS_IMPORT_NAME ,
12- AXIOS_PROMISE_TYPE_NAME ,
13- AXIOS_QUEST_CONFIG_TYPE_NAME ,
12+ AXIOS_REQUEST_TYPE_NAME ,
13+ AXIOS_RESPONSE_TYPE_NAME ,
1414 AXIOS_TYPE_IMPORT_FILE ,
1515} from './const' ;
1616import {
@@ -331,8 +331,8 @@ export class Printer {
331331 axiosImportName = '' ,
332332 axiosImportFile,
333333 axiosTypeImportFile,
334- axiosRequestConfigTypeName = AXIOS_QUEST_CONFIG_TYPE_NAME ,
335- axiosResponseTypeName = AXIOS_PROMISE_TYPE_NAME ,
334+ axiosRequestConfigTypeName = AXIOS_REQUEST_TYPE_NAME ,
335+ axiosResponseTypeName = AXIOS_RESPONSE_TYPE_NAME ,
336336 } = this . options || { } ;
337337 const { cwd = '/' , file } = this . configs ;
338338 const axiosImportFile2 = axiosImportFile || AXIOS_IMPORT_FILE ;
@@ -343,13 +343,13 @@ export class Printer {
343343 return [
344344 toImportString ( AXIOS_IMPORT_NAME , axiosImportName , importPath ) ,
345345 toImportString (
346- AXIOS_QUEST_CONFIG_TYPE_NAME ,
346+ AXIOS_REQUEST_TYPE_NAME ,
347347 axiosRequestConfigTypeName ,
348348 importTypePath ,
349349 true ,
350350 ) ,
351351 toImportString (
352- AXIOS_PROMISE_TYPE_NAME ,
352+ AXIOS_RESPONSE_TYPE_NAME ,
353353 axiosResponseTypeName ,
354354 importTypePath ,
355355 true ,
@@ -452,7 +452,7 @@ export class Printer {
452452 path . setUrl ( url ) ; // 设置 url,用于解析 path 参数
453453 const data = new Arg ( argNamed , 'data' , this . schemata , options , true ) ;
454454 const config = new Arg ( argNamed , 'config' , this . schemata , options , true ) ;
455- config . setDefaultType ( AXIOS_QUEST_CONFIG_TYPE_NAME ) ;
455+ config . setDefaultType ( AXIOS_REQUEST_TYPE_NAME ) ;
456456 const resp = new Arg ( argNamed , 'response' , this . schemata , options , true ) ;
457457 const { parameters, requestBody, responses, operationId } = operation ;
458458
@@ -539,7 +539,7 @@ export class Printer {
539539 jsDoc . addComments ( responseArgs . toComments ( ) ) ;
540540
541541 return `${ jsDoc . print ( ) }
542- export async function ${ funcName } (${ requestArgs . toArgs ( ) } ): ${ AXIOS_PROMISE_TYPE_NAME } <${ respType } > {
542+ export async function ${ funcName } (${ requestArgs . toArgs ( ) } ): ${ AXIOS_RESPONSE_TYPE_NAME } <${ respType } > {
543543 return ${ AXIOS_IMPORT_NAME } ({
544544 method: ${ JSON . stringify ( method . toUpperCase ( ) ) } ,
545545 ${ requestArgs . toValues ( ) }
0 commit comments