File tree Expand file tree Collapse file tree 1 file changed +20
-9
lines changed Expand file tree Collapse file tree 1 file changed +20
-9
lines changed Original file line number Diff line number Diff line change @@ -153,22 +153,33 @@ protected function mergeGlobalOrAppEvents($events,$eventType='after'){
153153 */
154154 protected function handleApiResponseSuccess ($ apiInfo ,$ textAnnotations ){
155155 $ returned = $ apiInfo ['returned ' ];
156- if (
157- in_array ("NotResponses " , $ textAnnotations ) ||
158- in_array ("NotResponseSuccess " , $ textAnnotations )
159- ) {
160- return $ returned ;
161- }
156+
162157 $ config = $ this ->config ;
163158 $ mergeParams = [];
164159 $ paramType ='success ' ;
165- if (!empty ($ apiInfo ['responseSuccess ' ]) && count ($ apiInfo ['responseSuccess ' ])){
166- $ mergeParams = $ apiInfo ['responseSuccess ' ];
167- }else if (!empty ($ this ->currentApp ['responses ' ]) && !empty ($ this ->currentApp ['responses ' ][$ paramType ])){
160+
161+ if (!empty ($ this ->currentApp ['responses ' ]) && !empty ($ this ->currentApp ['responses ' ][$ paramType ])){
168162 $ mergeParams = $ this ->currentApp ['params ' ][$ paramType ];
169163 }else if (!empty ($ config ['responses ' ]) && !empty ($ config ['responses ' ][$ paramType ])){
170164 $ mergeParams = $ config ['responses ' ][$ paramType ];
171165 }
166+
167+ if (
168+ (
169+ in_array ("NotResponses " , $ textAnnotations ) ||
170+ in_array ("NotResponseSuccess " , $ textAnnotations )
171+ ) &&
172+ count ($ mergeParams )>0
173+ ) {
174+ // 注解了不使用全局响应
175+ $ mergeParams = [];
176+ }
177+
178+ if (!empty ($ apiInfo ['responseSuccess ' ]) && count ($ apiInfo ['responseSuccess ' ])){
179+
180+ $ mergeParams = Helper::arrayMergeAndUnique ("name " , $ mergeParams ,$ apiInfo ['responseSuccess ' ]);
181+ }
182+
172183 if (!empty ($ mergeParams ) && count ($ mergeParams )){
173184 $ resData = [];
174185 foreach ($ mergeParams as $ item ) {
You can’t perform that action at this time.
0 commit comments