- xcx修改密码

- 访客二维码展示问题
This commit is contained in:
2025-09-11 17:54:19 +08:00
parent 53906a1ec3
commit 14901197cf
5 changed files with 72 additions and 17 deletions

View File

@@ -83,11 +83,10 @@ public class RemoteVisitorServiceImpl implements RemoteVisitorService {
@Override
public Map<String, Object> getQrCode(Long id) {
try {
ApiResp res = e8PlatformApi.getVisitorQrCode(List.of(id));
Assert.notNull(res, "e8平台获取访客二维码失败");
return res.getCode() == 0
? Map.of("code", 200, "data",
JSONUtil.toList(JSONUtil.toJsonStr(res.getResult()), VisitorAddRes.class).get(0).getQrCodeStr())
ApiResp<VisitorAddRes> res = e8PlatformApi.getVisitorQrCode(List.of(id));
Assert.isTrue(res.getSuccess(), res.getMessage());
return res.getSuccess()
? Map.of("code", 200, "data,", res.getResult().getQrCodeStr())
: Map.of("code", 500, "data", res.getMessage());
} catch (Exception e) {

View File

@@ -82,11 +82,11 @@ public class E8PlatformApiService implements E8PlatformApi {
}
return new ApiResp<>(
apiResp.getStr("message"),
apiResp.getLong("sessionId"),
data,
apiResp.getBool("success"),
apiResp.getInt("code")
apiResp.getStr("message"),
apiResp.getLong("sessionId"),
data,
apiResp.getBool("success"),
apiResp.getInt("code")
);
}
@@ -104,7 +104,7 @@ public class E8PlatformApiService implements E8PlatformApi {
}
JSONObject apiResp = JSONUtil.parseObj(result);
Map<String, Object> resultMap = JSONUtil.toBean(apiResp.getStr("result"), new TypeReference<Map<String, Object>>() {
Map<String, Object> resultMap = JSONUtil.toBean(apiResp.getStr("result"), new TypeReference<>() {
}, false);
TableDataInfo<T> tableDataInfo = new TableDataInfo<>();
@@ -114,11 +114,11 @@ public class E8PlatformApiService implements E8PlatformApi {
tableDataInfo.setMsg("查询成功");
return new ApiResp<>(
apiResp.getStr("message"),
apiResp.getLong("sessionId"),
tableDataInfo,
apiResp.getBool("success"),
apiResp.getInt("code")
apiResp.getStr("message"),
apiResp.getLong("sessionId"),
tableDataInfo,
apiResp.getBool("success"),
apiResp.getInt("code")
);
}
@@ -636,6 +636,12 @@ public class E8PlatformApiService implements E8PlatformApi {
// 执行客户创建API调用并获取API响应对象
String result = e8ApiUtil.doPost(params, VISITOR_QRCODE);
return handleApiResponse(result, VisitorAddRes.class);
if (result == null) {
return new ApiResp<>("E8服务器内部错误", null, null, false, 500);
}
JSONObject apiResp = JSONUtil.parseObj(result);
List<VisitorAddRes> info = JSONUtil.toList(apiResp.getJSONArray("result"), VisitorAddRes.class);
VisitorAddRes res = info.isEmpty() ? null : info.get(0);
return new ApiResp<>(apiResp.getStr("message"), apiResp.getLong("sessionId"), res, apiResp.getBool("success"), apiResp.getInt("code"));
}
}