diff --git a/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/api/apijson/StringUtil.js b/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/api/apijson/StringUtil.js index 1b0a7ec..45df675 100644 --- a/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/api/apijson/StringUtil.js +++ b/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/api/apijson/StringUtil.js @@ -368,9 +368,37 @@ var StringUtil = { isFileUrl: function (s) { return StringUtil.isUrl(s, ['file']); }, - isPath: function (s) { + isFilePath: function (s) { + return StringUtil.isPath(s, false); + }, + isUrlPath: function (s) { + return StringUtil.isPath(s, true); + }, + isPath: function (s, allowQuery) { + if (StringUtil.isEmpty(s)) { + return false; + } + + if (allowQuery) { + var ind = s.indexOf('#') + if (ind >= 0) { + s = s.substring(0, ind); + } + ind = s.indexOf('?') + if (ind >= 0) { + s = s.substring(0, ind); + } + } + + if (s.startsWith('/')) { + s = s.substring(1); + } + if (s.endsWith('/')) { + s = s.substring(0, s.length - 1); + } + var arr = StringUtil.split(s, '/'); - if (arr == null || arr.length <= 1) { + if (arr == null || arr.length <= 0) { // 1) { return false; } diff --git a/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/api/index.html b/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/api/index.html index cf73be0..2e1df8a 100755 --- a/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/api/index.html +++ b/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/api/index.html @@ -203,7 +203,7 @@
  • - {{(isCaseGroupEditable ? '' : (StringUtil.isEmpty(item.groupName) ? '-' : item.groupName) + ' ') + item.groupUrl}}{{' (' + item.count + ') '}} + {{(isCaseGroupEditable ? '' : (isCaseItemShow() && StringUtil.isNotEmpty(item.groupName) ? '' : (index + 1) + '. ') + (StringUtil.isEmpty(item.groupName) ? '' : item.groupName) + ' ') + item.groupUrl}}{{' (' + item.count + ') '}} @@ -237,7 +237,7 @@
  • - {{ isCaseGroupEditable ? '' : item.Chain.groupName }} + {{ (isCaseItemShow() ? '' : (index + 1) + '. ') + (isCaseGroupEditable ? '' : item.Chain.groupName) }}