Skip to content

Commit 5630340

Browse files
committed
Java: MultiDataSource 完善 APIAuto 路径判断、解决生成参数注入配置报错 config2 未定义;解决 UIGOD 显示事件名报错找不到 EditTextEvent 类
1 parent a4f20e3 commit 5630340

File tree

4 files changed

+357
-295
lines changed

4 files changed

+357
-295
lines changed

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

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -368,9 +368,37 @@ var StringUtil = {
368368
isFileUrl: function (s) {
369369
return StringUtil.isUrl(s, ['file']);
370370
},
371-
isPath: function (s) {
371+
isFilePath: function (s) {
372+
return StringUtil.isPath(s, false);
373+
},
374+
isUrlPath: function (s) {
375+
return StringUtil.isPath(s, true);
376+
},
377+
isPath: function (s, allowQuery) {
378+
if (StringUtil.isEmpty(s)) {
379+
return false;
380+
}
381+
382+
if (allowQuery) {
383+
var ind = s.indexOf('#')
384+
if (ind >= 0) {
385+
s = s.substring(0, ind);
386+
}
387+
ind = s.indexOf('?')
388+
if (ind >= 0) {
389+
s = s.substring(0, ind);
390+
}
391+
}
392+
393+
if (s.startsWith('/')) {
394+
s = s.substring(1);
395+
}
396+
if (s.endsWith('/')) {
397+
s = s.substring(0, s.length - 1);
398+
}
399+
372400
var arr = StringUtil.split(s, '/');
373-
if (arr == null || arr.length <= 1) {
401+
if (arr == null || arr.length <= 0) { // 1) {
374402
return false;
375403
}
376404

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3485,7 +3485,7 @@ https://github.com/Tencent/APIJSON/issues
34853485
}
34863486

34873487
configs.push(config)
3488-
config2 = StringUtil.trim(this.newRandomConfig(null, '', req, true))
3488+
var config2 = StringUtil.trim(this.newRandomConfig(null, '', req, true))
34893489
if (StringUtil.isNotEmpty(config2, true)) {
34903490
configs.push(config2)
34913491
}

0 commit comments

Comments
 (0)