|
@@ -33,20 +33,29 @@ public class AuthLicenseController {
|
|
|
|
|
|
@GetMapping("/getAuthInfo")
|
|
|
public ResultData getAuthInfo(){
|
|
|
- JSONObject jsonObject = AuthLicenseUtil.readLicense();
|
|
|
- JSONObject licenseInfo = jsonObject.getJSONObject("licenseInfo");
|
|
|
- JSONObject snInfo = licenseInfo.getJSONObject("snInfo");
|
|
|
- String endDate = snInfo.getStr("endDate");
|
|
|
- String sn = snInfo.getStr("sn");
|
|
|
- Date date = DateUserUtil.getDate(endDate);
|
|
|
- Long days = DateUserUtil.between(date,new Date());
|
|
|
- snInfo.set("expirationDays",days);
|
|
|
- if(StringUtils.isNotBlank(sn)){
|
|
|
- String snPassWord = "***";
|
|
|
- if(sn.length() > 6){
|
|
|
- snPassWord = sn.substring(0, 3) + "******" + sn.substring(sn.length()-3, sn.length());
|
|
|
+ JSONObject jsonObject = null;
|
|
|
+ try {
|
|
|
+ System.out.println(1/0);
|
|
|
+ jsonObject = AuthLicenseUtil.readLicense();
|
|
|
+ JSONObject licenseInfo = jsonObject.getJSONObject("licenseInfo");
|
|
|
+ JSONObject snInfo = licenseInfo.getJSONObject("snInfo");
|
|
|
+ String endDate = snInfo.getStr("endDate");
|
|
|
+ String sn = snInfo.getStr("sn");
|
|
|
+ Date date = DateUserUtil.getDate(endDate);
|
|
|
+ Long days = DateUserUtil.between(date,new Date());
|
|
|
+ snInfo.set("expirationDays",days);
|
|
|
+ if(StringUtils.isNotBlank(sn)){
|
|
|
+ String snPassWord = "***";
|
|
|
+ if(sn.length() > 6){
|
|
|
+ snPassWord = sn.substring(0, 3) + "******" + sn.substring(sn.length()-3, sn.length());
|
|
|
+ }
|
|
|
+ snInfo.set("sn", snPassWord);
|
|
|
}
|
|
|
- snInfo.set("sn", snPassWord);
|
|
|
+ }catch (Exception e){
|
|
|
+ jsonObject = new JSONObject();
|
|
|
+ JSONObject licenseInfo = new JSONObject();
|
|
|
+ licenseInfo.set("snInfo",new JSONObject());
|
|
|
+ jsonObject.set("licenseInfo",licenseInfo);
|
|
|
}
|
|
|
return ResultData.ok(jsonObject);
|
|
|
}
|