Skip to content

Commit d6fce04

Browse files
committed
解决用例列表一键测试报错;优化默认配置及项目介绍;Header 输入框暂时移到参数注入上方
1 parent ce20df6 commit d6fce04

File tree

3 files changed

+102
-115
lines changed

3 files changed

+102
-115
lines changed

apijson/JSONRequest.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
const TAG_REQUEST_UTIL = 'RequestUtil';
2222

23-
var URL_BASE = "http://apijson.cn:8080"; // 基地址
23+
var URL_BASE = "jdbc:mysql://localhost:3306"; // 基地址
2424
var URL_GET = URL_BASE + "/get"; // 常规获取数据方式
2525
var URL_HEAD = URL_BASE + "/head"; // 检查,默认是非空检查,返回数据总数
2626
var URL_GETS = URL_BASE + "/gets"; // 通过POST来GET数据,不显示请求内容和返回结果,一般用于对安全要求比较高的请求

index.html

Lines changed: 34 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<!DOCTYPE html>
22
<html>
33
<head>
4-
<title>SQLAuto-机器学习零代码测试、生成代码与静态检查、生成文档与光标悬浮注释</title>
4+
<title>SQLAuto-机器学习零代码测试 SQL、任意增删改查、任意 SQL 模板变量、一键批量生成</title>
55
<meta charset="utf-8" />
6-
<meta name="keywords" content="apijson,api,json,auto,apiauto,自动生成接口文档,自动化接口回归测试,机器学习接口回归测试,回归测试,机器学习,接口测试,API测试,自动化,API自动化,接口自动化,fastjson,json在线解析,json格式化验证"/>
7-
<meta name="description" content="SQLAuto-敏捷开发最强大易用的 HTTP 接口工具,机器学习零代码测试、生成代码与静态检查、生成文档与光标悬浮注释"/>
6+
<meta name="keywords" content="apijson,sql,auto,sqlauto,自动生成接口文档,自动化接口回归测试,机器学习接口回归测试,回归测试,机器学习,数据库测试,SQL测试,自动化,SQL 自动化,数据库自动化"/>
7+
<meta name="description" content="SQLAuto-机器学习零代码测试 SQL、任意增删改查、任意 SQL 模板变量、一键批量生成"/>
88

99
<!-- 登录 <<<<<<<<<<<<<<<<<<<< -->
1010
<link rel="stylesheet" type="text/css" href="bootstrap/css/bootstrap.min.css">
@@ -118,7 +118,7 @@
118118
<a style="border-bottom: #DDD 1px solid;width: 100%" href="javascript:void(0)" @click="showConfig(true, 1)">数据库名/模式 Schema: {{ schema || '例如 sys' }}</a>
119119
<a v-show="User.id == null || User.id <= 0" style="border-bottom: #DDD 1px solid;width: 100%" href="javascript:void(0)" @click="showConfig(true, 7)">使用的请求类型: {{ types == null || types.length <= 0 ? '点击设置' : (types instanceof Array ? types.join() : types) }}</a>
120120
<a v-show="User.id == null || User.id <= 0" style="border-bottom: #DDD 1px solid;width: 100%" href="javascript:void(0)" @click="showConfig(true, 6)">托管服务器地址 URL: {{ server || '点击设置' }}</a>
121-
<a v-show="User.id != null && User.id > 0" style="border-bottom: #DDD 1px solid;width: 100%" href="javascript:void(0)" @click="showConfig(true, 8)">导入第三方文档(平台名 URL): <br/>{{ thirdParty || '点击设置' }}</a>
121+
<a v-show="false && User.id != null && User.id > 0" style="border-bottom: #DDD 1px solid;width: 100%" href="javascript:void(0)" @click="showConfig(true, 8)">导入第三方文档(平台名 URL): <br/>{{ thirdParty || '点击设置' }}</a>
122122
</ul>
123123
</span>
124124

@@ -173,7 +173,7 @@
173173
<ul v-show="isTestCaseShow" class="historys" style="width: 100%;height: 100%;overflow: hidden;overflow-y: scroll;padding-bottom: 50px">
174174
<li v-for="(item, index) in testCases" >
175175
<div style="display: inline-table">
176-
<button v-show="types != null && types.length > 1" style="width: 48px;margin-right: 6px;padding: 0px;position: relative" id="vDocType" @click="restoreRemoteAndTest(index, item)">{{ getTypeName(item.Document.type) }}</button>
176+
<button v-show="false && types != null && types.length > 1" style="width: 48px;margin-right: 6px;padding: 0px;position: relative" id="vDocType" @click="restoreRemoteAndTest(index, item)">{{ getTypeName(item.Document.type) }}</button>
177177
<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>
178178
<div :style="{ background: item.compareColor }" v-show="item.compareType != null" style="position: absolute;top: 8px;right: 36px;display: inline-block;">
179179
<button class="hint--left" ref="testResultButtons" @mouseover="setTestHint(index, item)" v-show="item.compareType != null" @click="handleTest(false, index, item)" style="position: relative;">{{ item.compareMessage + (item.showType == 'before' ? '-前' : '-后') }}</button>
@@ -196,36 +196,34 @@
196196
<textarea v-show="! isEditResponse" id="vWarning" style="width: 100%; height: 100%; position: absolute; z-index: 0; color: orangered; background-color: #0000;" wrap="off" disabled>
197197
</textarea>
198198
<textarea id="vInput" @copy="doOnCopy" @paste="doOnPaste" @keyup="onChange(true)" style="width: 100%;height: 100%; position: absolute; z-index: 100; background: #0000;" wrap="off" >SELECT `Comment`.`userId`, `User`.`id`, COUNT(1)
199-
FROM
200-
`sys`.`Comment` AS `Comment`
201-
INNER JOIN
202-
`sys`.`apijson_user` AS `User`
199+
FROM `sys`.`Comment` AS `Comment`
200+
INNER JOIN `sys`.`apijson_user` AS `User`
203201
ON `User`.`id` = `Comment`.`userId`
204-
AND (((`User`.`name` LIKE ${searchKey} )
205-
OR (`User`.`tag` REGEXP ${searchKey} )))
206-
GROUP BY `User`.`id`
207-
HAVING ((`User`.`id`) % 7 != 0)
208-
ORDER BY `User`.`id` ASC
209-
LIMIT ${limit}</textarea>
210-
<!-- <div id="editor" class="editor language-js hljs javascript" data-gramm="false" contenteditable="plaintext-only" spellcheck="false" style="width: 100%;height: 100%; z-index: 2000; background: none; outline: none; overflow-wrap: break-word; overflow-y: auto; white-space: pre-wrap;">SELECT-->
211-
<!-- `Comment`.`userId`, `User`.`id`, COUNT(1)-->
212-
<!--FROM-->
213-
<!-- `sys`.`Comment` AS `Comment`-->
214-
<!--INNER JOIN-->
215-
<!-- `sys`.`apijson_user` AS `User`-->
216-
<!-- ON `User`.`id` = `Comment`.`userId`-->
217-
<!-- AND (((`User`.`name` LIKE ${searchKey} )-->
218-
<!-- OR (`User`.`tag` REGEXP ${searchKey} )))-->
219-
<!--GROUP BY `User`.`id`-->
220-
<!--HAVING ((`User`.`id`) % 7 != 0)-->
221-
<!--ORDER BY `User`.`id` ASC-->
222-
<!--LIMIT ${limit}-->
223-
<!-- </div>-->
224-
202+
AND `User`.`name` LIKE ${searchKey}
203+
GROUP BY `User`.`id` HAVING ((`User`.`id`) % ${userId} != 0)
204+
ORDER BY `User`.`id` ASC LIMIT ${limit} OFFSET ${offset}</textarea>
225205
</div>
226206
<div id="vRequestMarkdown" v-show="isPreviewEnabled" style="width: 100%;height: 100%;position: relative;"></div>
227207

228208
<div style="width: 100%; height: auto; position: absolute;bottom: 0px; z-index: 100; background: white;" >
209+
<div v-show="isHeaderShow" style="width: 100%; height: 150px; position: relative;" >
210+
<div class="left-bar" style="border-top: #DDD 1px solid; position: relative">
211+
<a style="padding-left: 10px;padding-right: 2px;font-size: medium;color: black" >{{ (isEditResponse ? '响应头 Response Header' : '请求头 Request Header' ) }}<a style="display: flex;flex-grow: 1;padding-right: 10px;padding-top: 2px"> (每行都按 key: value 格式)</a></a>
212+
<a class="hint--top @cli-tool" data-hint="隐藏" style="float: right;padding: 8px;height: 100%" href="javascript:void(0)" @click="showConfig(false, 4)">
213+
<svg class="icon close-icon" >
214+
<use xlink:href="svg/icon.svg#close"></use>
215+
</svg>
216+
</a>
217+
</div>
218+
<textarea id="vHeader" @copy="doOnCopy" @paste="doOnPaste" @keyup="onChange(true)" style="width: 100%;height: 100%;" wrap="off" placeholder="Authorization: Basic YWRtaW46YWRtaW4= // 示例,支持单行注释
219+
My-Header: 'Secret' + Math.random() // 示例,代码执行结果作为实际值,值为 fun(arg0, arg1..) 等包含函数名与括号的格式
220+
// ## 快捷键
221+
// Ctrl + I 或 Command + I 格式化文本,清除所有注释和无效空格、换行等;
222+
// Ctrl + / 或 Command + / 对选中行 新增行注释 或 取消行注释;">searchKey: '%a%'
223+
userId: 82001
224+
limit: 3
225+
offset: 0</textarea>
226+
</div>
229227

230228
<div v-show="isRandomShow" style="width: 100%; height: 330px; position: relative;" >
231229
<div class="left-bar" style="border-top: #DDD 1px solid; position: relative">
@@ -343,11 +341,11 @@
343341
User/id: RANDOM_DB() // 从数据库随机取值,等价于 User/id: RANDOM_DB(null, null, 'User', 'id')
344342
[]/page: Math.round(100*Math.random()) // 通过 JavaScript 代码来自定义 [] 内的 page
345343
">
346-
User/id: RANDOM_INT(82001, 82020) // 随机整数
347-
[]/count: RANDOM_IN(5, 10, 's', false, [], {}) // 随机取值
348-
[]/page: Math.round(5*Math.random()) // 通过代码来自定义
349-
@explain: ORDER_IN(true, false) // 顺序取值
350-
// 从数据库随机取值 []/Comment/toId: RANDOM_DB()
344+
searchKey: '%a%' // 固定常量值
345+
userId: RANDOM_IN(82001, 82002, 82003) // 随机选项取值
346+
limit: ORDER_IN(1, 3, 5, 10) // 顺序选项取值
347+
offset: RANDOM_INT(0, 5) // 随机范围取值
348+
// 从数据库随机取值 userId: RANDOM_DB('Comment', 'userId')
351349

352350
// 注释可省略,但如果未省略则前面两个空格必须;清空文本内容可查看规则。
353351

@@ -356,24 +354,6 @@
356354
// Ctrl + / 或 Command + / 对选中行 新增行注释 或 取消行注释;
357355
</textarea>
358356
</div>
359-
360-
361-
<div v-show="isHeaderShow" style="width: 100%; height: 150px; position: relative;" >
362-
<div class="left-bar" style="border-top: #DDD 1px solid; position: relative">
363-
<a style="padding-left: 10px;padding-right: 2px;font-size: medium;color: black" >{{ (isEditResponse ? '响应头 Response Header' : '请求头 Request Header' ) }}<a style="display: flex;flex-grow: 1;padding-right: 10px;padding-top: 2px"> (每行都按 key: value 格式)</a></a>
364-
<a class="hint--top @cli-tool" data-hint="隐藏" style="float: right;padding: 8px;height: 100%" href="javascript:void(0)" @click="showConfig(false, 4)">
365-
<svg class="icon close-icon" >
366-
<use xlink:href="svg/icon.svg#close"></use>
367-
</svg>
368-
</a>
369-
</div>
370-
<textarea id="vHeader" @copy="doOnCopy" @paste="doOnPaste" @keyup="onChange(true)" style="width: 100%;height: 100%;" wrap="off" placeholder="Authorization: Basic YWRtaW46YWRtaW4= // 示例,支持单行注释
371-
My-Header: 'Secret' + Math.random() // 示例,代码执行结果作为实际值,值为 fun(arg0, arg1..) 等包含函数名与括号的格式
372-
// ## 快捷键
373-
// Ctrl + I 或 Command + I 格式化文本,清除所有注释和无效空格、换行等;
374-
// Ctrl + / 或 Command + / 对选中行 新增行注释 或 取消行注释;"></textarea>
375-
</div>
376-
377357
</div>
378358
</div>
379359
</div>
@@ -778,7 +758,7 @@
778758
var vVerify = document.getElementById("vVerify");
779759
var vRemember = document.getElementById("vRemember");
780760

781-
vUrl.value = new String(URL_BASE + '/get'); //main.js里访问不到,可能是script引用顺序问题
761+
vUrl.value = new String('jdbc:mysql://localhost:3306/sys'); //main.js里访问不到,可能是script引用顺序问题
782762

783763
var vRequestMarkdown = document.getElementById('vRequestMarkdown');
784764
var vMarkdown = document.getElementById('vMarkdown');

0 commit comments

Comments
 (0)