fix: 插件卸载逻辑

This commit is contained in:
fit2cloud-chenyw 2022-04-06 18:58:15 +08:00
parent 8922d86040
commit e9f779ad85
3 changed files with 7 additions and 4 deletions

View File

@ -524,6 +524,9 @@ public class ChartViewService {
fieldMap.put("extBubble",extBubble);
PluginViewParam pluginViewParam = buildPluginParam(fieldMap, fieldCustomFilter, extFilterList, ds, table, view);
String sql = pluginViewSql(pluginViewParam, view);
if (StringUtils.isBlank(sql)) {
return emptyChartViewDTO(view);
}
datasourceRequest.setQuery(sql);
data = datasourceProvider.getData(datasourceRequest);

View File

@ -255,14 +255,14 @@ public class PluginService {
}
public boolean versionMatch(String pluginVersion) {
List<Integer> versionLists = Arrays.stream(version.split(".")).map(CodingUtil::string2Integer).collect(Collectors.toList());
List<Integer> requireVersionLists = Arrays.stream(pluginVersion.split(".")).map(CodingUtil::string2Integer).collect(Collectors.toList());
List<Integer> versionLists = Arrays.stream(version.split("\\.")).map(CodingUtil::string2Integer).collect(Collectors.toList());
List<Integer> requireVersionLists = Arrays.stream(pluginVersion.split("\\.")).map(CodingUtil::string2Integer).collect(Collectors.toList());
int maxSize = Math.max(versionLists.size(), requireVersionLists.size());
for (int i = 0; i < maxSize; i++) {
Integer currentV = versionLists.size() == i ? 0 : versionLists.get(i);
Integer requireV = requireVersionLists.size() == i ? 0 : requireVersionLists.get(i);
if (requireV > currentV) return false;
}
return false;
return true;
}
}

View File

@ -14,7 +14,7 @@ export function pluginLists(page, size, data) {
export function uninstall(pluginId) {
return request({
url: pathMap.queryPath + pluginId,
url: pathMap.uninstallPath + pluginId,
method: 'post',
loading: true
})