Skip to content

Commit 73106c0

Browse files
committed
Demo: MultiDataSource 解决 APIAuto Response JSON 超过 2 层的 key 光标悬浮注释路径错误,断言总是漏报等
1 parent 6fb13d9 commit 73106c0

File tree

2 files changed

+3
-3
lines changed
  • APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/api

2 files changed

+3
-3
lines changed

APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/api/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -918,7 +918,7 @@
918918
<script type="text/x-template" id="item-template">
919919
<ul class="json-item">
920920
<vue-val :theme="theme" :field="key" :val="val" :isend="index == objLength(jsondata) - 1" :thiz="JSONResponse.isObject(jsondata) != true || StringUtil.isEmpty(jsondata._$_this_$_, true) ? {} : (JSON.parse(jsondata._$_this_$_) || {})"
921-
v-show="onRenderJSONItem(val, key, thiz == null ? null : thiz._$_path_$_)"
921+
v-show="onRenderJSONItem(val, key, (JSONResponse.isObject(jsondata) != true || StringUtil.isEmpty(jsondata._$_this_$_, true) ? {} : (thiz || JSON.parse(jsondata._$_this_$_) || {}))._$_path_$_)"
922922
v-for="(val, key, index) in jsondata"></vue-val>
923923
</ul>
924924
</script>

APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/api/js/main.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@
239239
var pathKeys = StringUtil.split(pathUri, '/');
240240
var target = App.isMLEnabled ? JSONResponse.getStandardByPath(standardObj, pathKeys) : JSONResponse.getValByPath(standardObj, pathKeys);
241241
var real = JSONResponse.getValByPath(responseObj, pathKeys);
242-
var cmp = App.isMLEnabled ? JSONResponse.compareWithStandard(target, real, path) : JSONResponse.compareWithBefore(target, real, path);
242+
var cmp = App.isMLEnabled ? JSONResponse.compareWithStandard(target, real, pathUri) : JSONResponse.compareWithBefore(target, real, pathUri);
243243
cmp.path = pathUri;
244244
var cmpShowObj = JSONResponse.getCompareShowObj(cmp);
245245
thiz[k] = [cmpShowObj.compareType, cmpShowObj.compareColor, cmpShowObj.compareMessage];
@@ -299,7 +299,7 @@
299299
var target = App.isMLEnabled ? JSONResponse.getStandardByPath(standardObj, pathKeys) : JSONResponse.getValByPath(standardObj, pathKeys);
300300
var real = JSONResponse.getValByPath(responseObj, pathKeys);
301301
// c = JSONResponse.compareWithBefore(target, real, path);
302-
var cmp = App.isMLEnabled ? JSONResponse.compareWithStandard(target, real, path) : JSONResponse.compareWithBefore(target, real, path);
302+
var cmp = App.isMLEnabled ? JSONResponse.compareWithStandard(target, real, pathUri) : JSONResponse.compareWithBefore(target, real, pathUri);
303303
cmp.path = pathUri;
304304
var cmpShowObj = JSONResponse.getCompareShowObj(cmp);
305305
thiz[k] = [cmpShowObj.compareType, cmpShowObj.compareColor, cmpShowObj.compareMessage];

0 commit comments

Comments
 (0)