Skip to content

Commit 81ca790

Browse files
committed
新增支持切换预编译和完整 SQL 两种模式;解决输入 URI 无效;
1 parent f624694 commit 81ca790

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@
133133
<!--<div :class="'side-left side-view-' + baseview">-->
134134
<div class="side-left">
135135
<div v-show="! isTestCaseShow" class="left-bar" >
136-
<button class="transfer" id="vTransfer" @click="transfer()">' / "</button>
136+
<button class="transfer" id="vTransfer" @click="transfer()">? | 0</button>
137137
<button v-show="false" class="transfer" id="vType" :disabled="isEditResponse" @click="changeType()">{{ getTypeName(type) }}</button>
138138
<div style="height: 100%;display: flex;flex-grow: 1">
139139
<input class="url" id="vUrlComment" :disabled="isEditResponse" type="text" style="width: 100%; position: absolute; z-index: -100; color: darkseagreen;background: #0000;" />

js/main.js

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -697,7 +697,7 @@
697697
host: '',
698698
database: 'MYSQL', // 查文档必须,除非后端提供默认配置接口 // 用后端默认的,避免用户总是没有配置就问为什么没有生成文档和注释 'MYSQL',// 'POSTGRESQL',
699699
schema: 'sys', // 查文档必须,除非后端提供默认配置接口 // 用后端默认的,避免用户总是没有配置就问为什么没有生成文档和注释 'sys',
700-
server: 'http://apijson.cn:9090', // Chrome 90+ 跨域问题非常难搞,开发模式启动都不行了 'http://apijson.org:9090', //apijson.cn
700+
server: 'http://apijson.cn:8080', // Chrome 90+ 跨域问题非常难搞,开发模式启动都不行了 'http://apijson.org:9090', //apijson.cn
701701
// server: 'http://47.74.39.68:9090', // apijson.org
702702
thirdParty: 'SWAGGER /v2/api-docs', //apijson.cn
703703
// thirdParty: 'RAP /repository/joined /repository/get',
@@ -3811,7 +3811,9 @@
38113811
this.parseRandom(vInput.value, vHeader.value, -1, true, false, false, function (randomName, constConfig, constJson) {
38123812
vOutput.value = "requesting... \nURL = " + url
38133813
App.view = 'output';
3814-
var req = constJson;
3814+
var req = Object.assign(constJson, {
3815+
uri: url
3816+
})
38153817

38163818
App.setBaseUrl()
38173819
App.request(isAdminOperation, App.type, App.server + "/execute", req, isAdminOperation ? {} : header, callback)
@@ -5358,19 +5360,19 @@ Content-Type: ` + contentType) + (StringUtil.isEmpty(headerStr, true) ? '' : hea
53585360

53595361
var invoke = function (val, which, p_k, pathKeys, key, lastKeyInPath) {
53605362
try {
5361-
if (generateConfig) {
5363+
// if (generateConfig) {
53625364
var configVal;
53635365
if (val instanceof Object) {
53645366
configVal = JSON.stringify(val);
53655367
}
53665368
else if (typeof val == 'string') {
5367-
configVal = '"' + val + '"';
5369+
configVal = "'" + val + "'";
53685370
}
53695371
else {
53705372
configVal = val
53715373
}
53725374
constConfigLines[which] = p_k + ': ' + configVal;
5373-
}
5375+
// }
53745376

53755377
if (generateName) {
53765378
var valStr;
@@ -5396,8 +5398,10 @@ Content-Type: ` + contentType) + (StringUtil.isEmpty(headerStr, true) ? '' : hea
53965398
// if (generateJSON) {
53975399
//先按照单行简单实现
53985400
//替换 JSON 里的键值对 key: value
5399-
code += 'var ' + key + ' = "?";\n';
5400-
arg.push(val);
5401+
code += 'var ' + key + ' = ' + (isSingle ? (typeof configVal == 'string' ? '"' + configVal + '"' : configVal) : "'?'") + ';\n';
5402+
if (isSingle != true) {
5403+
arg.push(val);
5404+
}
54015405
// }
54025406
}
54035407
catch (e) {

0 commit comments

Comments
 (0)