获取token增加https配置
This commit is contained in:
parent
7243eece3d
commit
fda791624e
|
|
@ -90,6 +90,9 @@ public class SalaryTokenUtil {
|
||||||
return heads;
|
return heads;
|
||||||
}
|
}
|
||||||
BaseBean baseBean = new BaseBean();
|
BaseBean baseBean = new BaseBean();
|
||||||
|
// 获取是否是https
|
||||||
|
String isHttps = baseBean.getPropValue("hrmSalaryBillToken", "is_https");
|
||||||
|
String httpKey = (StringUtils.isNotBlank(isHttps) && isHttps.equals("true")) ? "https://" : "http://";
|
||||||
RecordSet rs = new RecordSet();
|
RecordSet rs = new RecordSet();
|
||||||
Map<String, String> resultMap = new HashMap<>();
|
Map<String, String> resultMap = new HashMap<>();
|
||||||
|
|
||||||
|
|
@ -123,7 +126,7 @@ public class SalaryTokenUtil {
|
||||||
heads.put("appid", appid);
|
heads.put("appid", appid);
|
||||||
heads.put("cpk", cpk);
|
heads.put("cpk", cpk);
|
||||||
// 调用ECOLOGY系统接口进行注册
|
// 调用ECOLOGY系统接口进行注册
|
||||||
String data = post("http://" + ip + "/api/ec/dev/auth/regist", null, heads);
|
String data = post(httpKey + ip + "/api/ec/dev/auth/regist", null, heads);
|
||||||
Map<String, Object> datas = JSONObject.parseObject(data, new TypeReference<Map<String, Object>>() {});
|
Map<String, Object> datas = JSONObject.parseObject(data, new TypeReference<Map<String, Object>>() {});
|
||||||
// ECOLOGY返回的系统公钥
|
// ECOLOGY返回的系统公钥
|
||||||
String spk = (String) (datas.get("spk"));
|
String spk = (String) (datas.get("spk"));
|
||||||
|
|
@ -144,7 +147,7 @@ public class SalaryTokenUtil {
|
||||||
heads.put("appid", appid);
|
heads.put("appid", appid);
|
||||||
heads.put("secret", secret);
|
heads.put("secret", secret);
|
||||||
//调用ECOLOGY系统接口进行注册
|
//调用ECOLOGY系统接口进行注册
|
||||||
String data2 = post("http://" + ip + "/api/ec/dev/auth/applytoken", null, heads);
|
String data2 = post(httpKey + ip + "/api/ec/dev/auth/applytoken", null, heads);
|
||||||
// 通过第一步注册许可时返回spk公钥对userid进行加密生成的密文
|
// 通过第一步注册许可时返回spk公钥对userid进行加密生成的密文
|
||||||
sql= " SELECT conf_value FROM hrsa_salary_sys_conf t WHERE delete_type = 0 AND conf_key = 'SALARY_TOKEN_SPK'";
|
sql= " SELECT conf_value FROM hrsa_salary_sys_conf t WHERE delete_type = 0 AND conf_key = 'SALARY_TOKEN_SPK'";
|
||||||
rs.execute(sql);
|
rs.execute(sql);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue