Commit 6cf497be authored by wzp's avatar wzp

修改获取机顶盒密钥

parent e538c807
...@@ -137,10 +137,10 @@ public class ChinaMobileRestApiController extends BaseController { ...@@ -137,10 +137,10 @@ public class ChinaMobileRestApiController extends BaseController {
jsonObject.put("key", tBoxOperation.getPrivateKey()); jsonObject.put("key", tBoxOperation.getPrivateKey());
return getResult(jsonObject); return getResult(jsonObject);
} else { } else {
throw new InterfaceException("400", "您无权获取本单位机顶盒密钥"); return getFailResult("500", "您无权获取本单位机顶盒密钥");
} }
} }
throw new InterfaceException("400", "未查询到相关机顶盒信息"); return getFailResult("500", "未查询到相关机顶盒信息");
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
......
...@@ -109,6 +109,11 @@ public class TBoxOperationController extends BaseController { ...@@ -109,6 +109,11 @@ public class TBoxOperationController extends BaseController {
if (tBoxOperation != null && StringUtils.isNotBlank(tBoxOperation.getMac())) { if (tBoxOperation != null && StringUtils.isNotBlank(tBoxOperation.getMac())) {
tBoxOperation.setMac(tBoxOperation.getMac().toUpperCase()); tBoxOperation.setMac(tBoxOperation.getMac().toUpperCase());
} }
if (2==tBoxOperation.getStatus()) {
final ArrayList<String> rsaKeys = RSAUtils.createRSAKeys();
tBoxOperation.setPublicKey(rsaKeys.get(0));
tBoxOperation.setPrivateKey(rsaKeys.get(1));
}
boolean flag = tBoxOperationService.updateById(tBoxOperation); boolean flag = tBoxOperationService.updateById(tBoxOperation);
UpdateWrapper<TUser> wrapper = new UpdateWrapper<>(); UpdateWrapper<TUser> wrapper = new UpdateWrapper<>();
wrapper.eq("org_id", tBoxOperation.getOrganId()); wrapper.eq("org_id", tBoxOperation.getOrganId());
......
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