diff --git a/src/main/java/com/iflytop/handacid/app/core/state/DeviceState.java b/src/main/java/com/iflytop/handacid/app/core/state/DeviceState.java index 5bc68c2..a70047a 100644 --- a/src/main/java/com/iflytop/handacid/app/core/state/DeviceState.java +++ b/src/main/java/com/iflytop/handacid/app/core/state/DeviceState.java @@ -46,6 +46,9 @@ public class DeviceState { @Schema(description = "当前登录用户") private volatile User currentUser; + /** + * 获得当前设备的json快照,增加synchronized保证强一致 + */ public synchronized JSONObject toJSON() { JSONObject json = new JSONObject(); json.putOnce("channelState", new ArrayList<>(channelStateMap.values()));