Commit 799fad48 authored by ma's avatar ma

解决授权信息与绑定sn不一致但鉴权成功问题

parent 42978028
...@@ -102,6 +102,11 @@ public class AuthManager { ...@@ -102,6 +102,11 @@ public class AuthManager {
return false; return false;
} }
DeviceVo device = deviceManager.getDevice(sn); DeviceVo device = deviceManager.getDevice(sn);
String tempAppId = device.getAppId();
if (!appId.equals(tempAppId)) {
log.info("appId and sn no matching ...");
return false;
}
// 未绑定 // 未绑定
if (device.getSnBind() == null) { if (device.getSnBind() == null) {
log.info("bind sn null..."); log.info("bind sn null...");
......
...@@ -16,6 +16,9 @@ public class DeviceVo implements Serializable { ...@@ -16,6 +16,9 @@ public class DeviceVo implements Serializable {
@ApiModelProperty("设备Id") @ApiModelProperty("设备Id")
private int deviceId; private int deviceId;
@ApiModelProperty("应用Id")
private String appId;
@ApiModelProperty("应用名") @ApiModelProperty("应用名")
private String appName; private String appName;
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<mapper namespace="iot.sixiang.license.mapper.DeviceMapper"> <mapper namespace="iot.sixiang.license.mapper.DeviceMapper">
<select id="getDeviceList" resultType="iot.sixiang.license.model.vo.DeviceVo"> <select id="getDeviceList" resultType="iot.sixiang.license.model.vo.DeviceVo">
SELECT de.device_id,app_name,user_name,sn,sn_bind,de.status,de.create_time,de.update_time,de.device_id IN (select SELECT de.device_id, de.app_id, app_name,user_name,sn,sn_bind,de.status,de.create_time,de.update_time,de.device_id IN (select
device_id from device_black) AS blackFlag FROM device AS de device_id from device_black) AS blackFlag FROM device AS de
JOIN apply AS app ON de.app_id = app.app_id JOIN apply AS app ON de.app_id = app.app_id
JOIN `user` AS us ON us.user_id = app.user_id JOIN `user` AS us ON us.user_id = app.user_id
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment