|
369 | 369 | valString = valString.substring(0, i + 1) |
370 | 370 | // alert('valString = ' + valString) |
371 | 371 | var _$_this_$_ = JSON.parse(valString) || {} |
372 | | - path = _$_this_$_.path |
373 | | - table = _$_this_$_.table |
| 372 | + path = _$_this_$_ == null ? '' : _$_this_$_.path |
| 373 | + table = _$_this_$_ == null ? '' : _$_this_$_.table |
374 | 374 | } |
375 | 375 | } |
376 | 376 |
|
|
454 | 454 |
|
455 | 455 | // APIJSON <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< |
456 | 456 |
|
457 | | - var ERR_MSG = ` |
458 | | - |
459 | | -可能出现了一些问题,可以按照以下步骤解决: |
460 | | -1.检查网络连接是否畅通,可用浏览器打开右侧地址: https://www.baidu.com/s?wd=%22APIJSON%22 |
| 457 | + var ERR_MSG = `出现了一些问题,可以按照以下步骤解决: |
| 458 | +1.检查网络连接是否畅通,可用浏览器打开右侧地址: https://www.baidu.com/s?wd=%22APIJSON%22 |
461 | 459 | 2.检查 URL 是否为一个可用的 域名/IPV4 地址,可用浏览器打开试试:正常返回结果 或 非 GET 请求返回 Whitelabel Error Page,一般都没问题 |
462 | 460 | 3.开启或关闭 右上方 设置>托管服务器代理,然后再试:如果开启后才通应该是 CORS 跨域问题;关闭后才通应该是用外网服务代理来访问内网导致,可退出登录后修改退关服务器地址为内网的 APIJSON 代理服务地址 |
463 | 461 | 4.Disable 关闭 VPN 等 电脑/手机/平板 上的网络代理软件 App 客户端,或者切换代理服务器地址,然后再试 |
@@ -520,7 +518,7 @@ https://github.com/Tencent/APIJSON/issues |
520 | 518 | v = JSON.parse(v) |
521 | 519 | } |
522 | 520 | catch (e) { |
523 | | - this.log(e) |
| 521 | + console.log(e) |
524 | 522 | } |
525 | 523 | } |
526 | 524 |
|
@@ -4635,7 +4633,7 @@ https://github.com/Tencent/APIJSON/issues |
4635 | 4633 | var name = api == null ? null : api.name; |
4636 | 4634 | if (StringUtil.isEmpty(name, true) == false) { |
4637 | 4635 | this.urlComment = name; |
4638 | | - vUrlComment.value = vUrl.value + CodeUtil.getComment(this.urlComment, false, ' ') |
| 4636 | + vUrlComment.value = vUrl.value + CodeUtil.getComment(this.urlComment, false, ' ') |
4639 | 4637 | } |
4640 | 4638 | } |
4641 | 4639 |
|
@@ -5054,6 +5052,7 @@ https://github.com/Tencent/APIJSON/issues |
5054 | 5052 | // crossDomain: true |
5055 | 5053 | }) |
5056 | 5054 | .then(function (res) { |
| 5055 | + clearTimeout(errHandler) |
5057 | 5056 | var postEvalResult = evalPostScript(url, res, null) |
5058 | 5057 | if (postEvalResult == BREAK_ALL) { |
5059 | 5058 | return |
@@ -5366,7 +5365,7 @@ https://github.com/Tencent/APIJSON/issues |
5366 | 5365 | // vOutput.value = "Response:\nurl = " + url + "\nerror = " + err.message; |
5367 | 5366 | this.view = 'error'; |
5368 | 5367 | this.error = { |
5369 | | - msg: "Response:\nurl = " + url + "\nerror = " + err.message + ERR_MSG |
| 5368 | + msg: "Response:\nurl = " + url + "\nerror = " + err.message + '\n\n' + ERR_MSG |
5370 | 5369 | } |
5371 | 5370 | } |
5372 | 5371 | } |
@@ -6089,7 +6088,6 @@ Content-Type: ` + contentType) + (StringUtil.isEmpty(headerStr, true) ? '' : hea |
6089 | 6088 |
|
6090 | 6089 | //转为文档格式 |
6091 | 6090 | var doc = ''; |
6092 | | - var item; |
6093 | 6091 |
|
6094 | 6092 | //[] <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< |
6095 | 6093 | var list = docObj == null ? null : docObj['[]']; |
@@ -6236,7 +6234,7 @@ Content-Type: ` + contentType) + (StringUtil.isEmpty(headerStr, true) ? '' : hea |
6236 | 6234 | + ' \n -------- | -------------- '; |
6237 | 6235 |
|
6238 | 6236 | for (var i = 0; i < list.length; i++) { |
6239 | | - item = list[i]; |
| 6237 | + var item = list[i]; |
6240 | 6238 | if (item == null) { |
6241 | 6239 | continue; |
6242 | 6240 | } |
@@ -6265,7 +6263,7 @@ Content-Type: ` + contentType) + (StringUtil.isEmpty(headerStr, true) ? '' : hea |
6265 | 6263 | + ' \n -------- | ------------ | ------------ | ------------ '; |
6266 | 6264 |
|
6267 | 6265 | for (var i = 0; i < list.length; i++) { |
6268 | | - item = list[i]; |
| 6266 | + var item = list[i]; |
6269 | 6267 | if (item == null) { |
6270 | 6268 | continue; |
6271 | 6269 | } |
@@ -7883,7 +7881,7 @@ Content-Type: ` + contentType) + (StringUtil.isEmpty(headerStr, true) ? '' : hea |
7883 | 7881 | this.log('test for ' + i + ' >> try { header = this.getHeader(document.header) } catch (e) { \n' + e.message) |
7884 | 7882 | } |
7885 | 7883 | const header = hdr |
7886 | | - |
| 7884 | + |
7887 | 7885 | const caseScript = { |
7888 | 7886 | pre: item['Script:pre'], |
7889 | 7887 | post: item['Script:post'] |
@@ -7912,6 +7910,7 @@ Content-Type: ` + contentType) + (StringUtil.isEmpty(headerStr, true) ? '' : hea |
7912 | 7910 | } catch (e) { |
7913 | 7911 | App.log('test App.request >> } catch (e) {\n' + e.message) |
7914 | 7912 | } |
| 7913 | + |
7915 | 7914 | } |
7916 | 7915 |
|
7917 | 7916 | const otherErr = err |
@@ -10175,7 +10174,6 @@ Content-Type: ` + contentType) + (StringUtil.isEmpty(headerStr, true) ? '' : hea |
10175 | 10174 | App.selectIndex = -1; |
10176 | 10175 | App.options = []; |
10177 | 10176 | }) |
10178 | | - |
10179 | 10177 | } |
10180 | 10178 | } |
10181 | 10179 |
|
|
0 commit comments