fix(zookeeper-query): 修复 get data 不判断地址是否存在

This commit is contained in:
2023-05-14 00:43:57 +08:00
parent 381a0df77f
commit 63c678c882

View File

@@ -37,7 +37,11 @@ public class ZookeeperController {
@GetMapping("get_data")
public String getData(@RequestParam("path") String path) throws Exception {
return new String(client.getData().forPath(path));
if (existsPath(path)) {
return new String(client.getData().forPath(path));
} else {
return "";
}
}
@GetMapping("exists_lock")