Skip to content

Commit e30251a

Browse files
committed
APIAuto:场景串联用例新增支持绑定测试帐号,新增自定义退出登录 URL 等配置,错误码断言兼容多种情况
1 parent 1daf805 commit e30251a

File tree

3 files changed

+315
-54
lines changed

3 files changed

+315
-54
lines changed

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -190,15 +190,15 @@ var JSONResponse = {
190190
* @return
191191
*/
192192
isSuccess: function(obj) {
193-
if (obj == null) {
194-
return false
195-
}
193+
// if (obj == null) {
194+
// return false
195+
// }
196196

197197
if (obj instanceof Array == false && obj instanceof Object) {
198-
return obj[JSONResponse.KEY_CODE] == JSONResponse.CODE_SUCCESS;
198+
obj = obj[JSONResponse.KEY_CODE];
199199
}
200200

201-
return obj == JSONResponse.CODE_SUCCESS
201+
return obj == JSONResponse.CODE_SUCCESS || obj == 200 || (obj != null && (obj.toUpperCase() == "OK" || obj.toUpperCase() == "SUCCESS" || obj.toUpperCase() == "SUCCEED"))
202202
},
203203

204204
/**校验服务端是否存在table

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,7 @@
264264
<button class="hint--right" :data-hint="item.Document.url" v-show="isShowMethod()" style="width: 60px; margin-right: 0px;padding: 0px;" id="vDocMethod" @click="restoreRemoteAndTest(index, item)">{{ getMethodName(item.Document.method, item.Document.type) }}</button>
265265
<button class="hint--right" :data-hint="item.Document.request" v-show="isShowType()" style="width: 48px;margin-right: 6px;padding: 0px" id="vDocType" @click="restoreRemoteAndTest(index, item)">{{ getTypeName(item.Document.type, item.Document.method) }}</button>
266266
<a class="hint--rounded hint--no-animate" ref="testCaseTexts" @mouseover="setRequestHint(index, item)" href="javascript:void(0)" @click="restoreRemote(index, item)" :style="{ color: index == currentDocIndex ? 'black' : 'gray' }"> {{(item.Document.version > 0 ? 'V' + item.Document.version : 'V*') + ' ' + item.Document.name + ' ' + item.Document.url}}</a>
267+
<button v-show="isChainShow && isChainItemShow()" class="hint--left" :data-hint="StringUtil.isEmpty((item.Chain || {}).testAccount, true) ? '绑定帐号' : '解绑帐号 ' + (item.Chain || {}).testAccount + '@' + (((item.Chain || {}).testInfo || {}).baseUrl || '')" :style="{color: ((item.Chain || {}).testInfo || {}).isLoggedIn ? 'red' : 'black' }" style="position: absolute; right: 31px;" id="vDocAccount" @click="bindAccount(index, item)">{{ (item.Chain || {}).testName || (item.Chain || {}).testAccount || '+' }}</button>
267268
<div v-show="isStatisticsEnabled" style="position: absolute; right: 31px; top: 9px; display: inline-flex">
268269
<div v-show="(item.totalCount || 0) > 0" style="background: lightgray; padding: 1px; margin-right: 2px; display: inline-block; position: relative" @click="restoreRemote(index, item, null, true)" >
269270
<!-- 只能写成一行来消除间隙,不能换行、空格 -->

0 commit comments

Comments
 (0)