|
@@ -22,6 +22,38 @@ public class PermissionService2 {
|
|
|
public String LogFromPCS(EncryptionLoginDTO encryptionLoginDTO) throws IOException {
|
|
|
String param = new Gson().toJson(encryptionLoginDTO);
|
|
|
RequestBody requestBody = RequestBody.create(MediaType.parse("application/json"), param);
|
|
|
+ OkHttpClient okHttpClient = new OkHttpClient();
|
|
|
+ Request request = new Request.Builder()
|
|
|
+ .url("http://47.116.194.135:8085" + "/api/permission/api/admin/loginByEncryption")
|
|
|
+ .post(requestBody)
|
|
|
+ .build();
|
|
|
+ return Objects.requireNonNull(okHttpClient.newCall(request).execute().body()).string();
|
|
|
+ }
|
|
|
+
|
|
|
+ public String getPermission(String token) throws IOException {
|
|
|
+ String appKey = "4e95e3d926a2a4befa5d913acc0aa9f5";
|
|
|
+ EncryptionFunctionDTO encryptionFunctionDTO =new EncryptionFunctionDTO();
|
|
|
+ long currentTimeMillis = System.currentTimeMillis();
|
|
|
+ encryptionFunctionDTO.setCurrentTimeMillis(currentTimeMillis);
|
|
|
+ encryptionFunctionDTO.setAppKey(appKey);
|
|
|
+ String appSecret = appKey + currentTimeMillis / 1000;
|
|
|
+ String md5Sign = SecureUtil.md5(appSecret);
|
|
|
+ encryptionFunctionDTO.setSign(md5Sign);
|
|
|
+ String param = new Gson().toJson(encryptionFunctionDTO);
|
|
|
+
|
|
|
+ RequestBody requestBody = RequestBody.create(MediaType.parse("application/json"), param);
|
|
|
+ OkHttpClient okHttpClient = new OkHttpClient();
|
|
|
+ Request request = new Request.Builder()
|
|
|
+ .url("http://47.116.194.135:8085" + "/api/permission/api/admin/functionByEncryption")
|
|
|
+ .addHeader("Cookie", "token="+token)
|
|
|
+ .post(requestBody)
|
|
|
+ .build();
|
|
|
+ return Objects.requireNonNull(okHttpClient.newCall(request).execute().body()).string();
|
|
|
+ }
|
|
|
+
|
|
|
+ public String LogFromPCS1(EncryptionLoginDTO encryptionLoginDTO) throws IOException {
|
|
|
+ String param = new Gson().toJson(encryptionLoginDTO);
|
|
|
+ RequestBody requestBody = RequestBody.create(MediaType.parse("application/json"), param);
|
|
|
OkHttpClient okHttpClient = new OkHttpClient.Builder()
|
|
|
.connectTimeout(60, TimeUnit.SECONDS)
|
|
|
.writeTimeout(60, TimeUnit.SECONDS)
|
|
@@ -34,7 +66,7 @@ public class PermissionService2 {
|
|
|
return Objects.requireNonNull(okHttpClient.newCall(request).execute().body()).string();
|
|
|
}
|
|
|
|
|
|
- public String getPermission(String token) throws IOException {
|
|
|
+ public String getPermission1(String token) throws IOException {
|
|
|
String appKey = "4e95e3d926a2a4befa5d913acc0aa9f5";
|
|
|
EncryptionFunctionDTO encryptionFunctionDTO =new EncryptionFunctionDTO();
|
|
|
long currentTimeMillis = System.currentTimeMillis();
|