From 4feeef310f9c604e1dab24fdffbffc3e1e0cd36b Mon Sep 17 00:00:00 2001 From: 51976 <519763495@qq.com> Date: Fri, 15 Jul 2022 15:49:33 +0800 Subject: [PATCH] =?UTF-8?q?1.=E5=AF=B9=E6=8E=A5ca=E7=99=BB=E5=BD=95?= =?UTF-8?q?=E8=AE=A4=E8=AF=81=EF=BC=8C=E5=AE=9E=E7=8E=B0=E4=BD=BF=E7=94=A8?= =?UTF-8?q?CA=E7=94=B5=E5=AD=90=E7=AD=BE=E5=90=8D=E5=AE=8C=E6=88=90?= =?UTF-8?q?=E7=99=BB=E5=BD=95=E8=AE=A4=E8=AF=81=202.=E5=BD=92=E6=A1=A3?= =?UTF-8?q?=E7=97=85=E5=8E=86=E5=8F=AC=E5=9B=9E=E6=97=B6=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E5=BC=B9=E6=A1=86=E6=8F=90=E9=86=92=EF=BC=88=E2=80=9C=E6=8F=90?= =?UTF-8?q?=E9=86=92=E6=82=A3=E6=96=B9=E5=8F=8A=E7=AC=AC=E4=B8=89=E6=96=B9?= =?UTF-8?q?=E5=B7=B2=E7=94=B3=E8=AF=B7=E4=BD=BF=E7=94=A8=E8=BF=87=E7=97=85?= =?UTF-8?q?=E5=8E=86=E2=80=9D=EF=BC=89=203.=E9=94=81=E5=AE=9A=E7=8A=B6?= =?UTF-8?q?=E6=80=81=E7=97=85=E5=8E=86=EF=BC=8C=E5=B8=B8=E7=94=A8=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E9=A1=B5=E9=9D=A2=E6=97=A0=E6=B3=95=E5=80=9F=E9=98=85?= =?UTF-8?q?=EF=BC=8C=E7=94=B3=E8=AF=B7=E5=88=97=E8=A1=A8=E5=80=9F=E9=98=85?= =?UTF-8?q?=E5=90=8E=E6=97=A0=E6=B3=95=E7=9B=B4=E6=8E=A5=E6=9F=A5=E7=9C=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/methodForEmrMedical.java | 109 ++++++++++++++++++ .../webapp/WEB-INF/views/loginDir/login.jsp | 8 +- .../src/main/webapp/static/js/login.js | 37 ++++++ .../main/webapp/static/js/updatePassword.js | 2 +- 4 files changed, 153 insertions(+), 3 deletions(-) diff --git a/power-admin/src/main/java/com/manage/controller/methodForEmrMedical.java b/power-admin/src/main/java/com/manage/controller/methodForEmrMedical.java index 3a87664..dc963e3 100644 --- a/power-admin/src/main/java/com/manage/controller/methodForEmrMedical.java +++ b/power-admin/src/main/java/com/manage/controller/methodForEmrMedical.java @@ -1,6 +1,7 @@ package com.manage.controller; +import com.alibaba.fastjson.JSONObject; import com.manage.encrypt.Base64; import com.manage.encrypt.MD5; import com.manage.entity.Power_Dept; @@ -17,6 +18,13 @@ import com.manage.vo.User_Dept_Menu; import org.apache.commons.lang3.StringUtils; import org.apache.cxf.endpoint.Client; import org.apache.cxf.jaxws.endpoint.dynamic.JaxWsDynamicClientFactory; +import org.apache.http.HttpEntity; +import org.apache.http.client.ClientProtocolException; +import org.apache.http.client.methods.CloseableHttpResponse; +import org.apache.http.client.methods.HttpGet; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClientBuilder; +import org.apache.http.util.EntityUtils; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; @@ -27,6 +35,7 @@ import org.springframework.web.bind.annotation.ResponseBody; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import java.io.IOException; import java.util.*; /** @@ -88,6 +97,106 @@ public class methodForEmrMedical { } } +// @RequestMapping(value = "getErweima") +// @ResponseBody +// public JSONObject getErweima(String responseType, String clientId, HttpServletRequest request){ +// // 获得Http客户端 +// CloseableHttpClient httpClient = HttpClientBuilder.create().build(); +// // 创建Get请求 +// HttpGet httpGet = new HttpGet("https://test.51trust.com/gateway/oauth/authorize?responseType=code&clientId=2017070411003376"); +// // 请求头 +// httpGet.setHeader("Content-Type", "application/json;charset=utf8"); +// // 响应模型 +// CloseableHttpResponse response = null; +// HttpEntity responseEntity=null; +// JSONObject jsonObject = null; +// try { +// // 由客户端执行(发送)Get请求 +// response = httpClient.execute(httpGet); +// // 从响应模型中获取响应实体 +// responseEntity = response.getEntity(); +// System.out.println("responseEntity::::"+responseEntity); +// System.out.println("响应状态为:" + response.getStatusLine()); +// if (responseEntity != null) { +// jsonObject = JSONObject.parseObject(EntityUtils.toString(responseEntity)); +// String contents = jsonObject.getString("contents"); +// JSONObject contentsObject = JSONObject.parseObject(contents); +// String userToken = contentsObject.getString("userToken"); +// String verifyStatus = contentsObject.getString("verifyStatus"); +// +// } +// } catch (ClientProtocolException e) { +// e.printStackTrace(); +// } catch (IOException e) { +// e.printStackTrace(); +// } finally { +// try { +// // 释放资源 +// if (httpClient != null) { +// httpClient.close(); +// } +// if (response != null) { +// response.close(); +// } +// } catch (IOException e) { +// e.printStackTrace(); +// } +// return jsonObject; +// } +// +// //return jsonObject; +// } +// +// @RequestMapping(value = "getUser") +// @ResponseBody +// public JSONObject getUser(String requestId, HttpServletRequest request){ +// // 获得Http客户端 +// CloseableHttpClient httpClient = HttpClientBuilder.create().build(); +// // 创建Get请求 +// HttpGet httpGet = new HttpGet("https://test.51trust.com/gateway/oauth/tokeninfo?clientId=2017070411003376&requestId=" + requestId); +// // 请求头 +// httpGet.setHeader("Content-Type", "application/json;charset=utf8"); +// // 响应模型 +// CloseableHttpResponse response = null; +// HttpEntity responseEntity=null; +// JSONObject jsonObject = null; +// try { +// // 由客户端执行(发送)Get请求 +// response = httpClient.execute(httpGet); +// // 从响应模型中获取响应实体 +// responseEntity = response.getEntity(); +// System.out.println("responseEntity::::"+responseEntity); +// System.out.println("响应状态为:" + response.getStatusLine()); +// if (responseEntity != null) { +// jsonObject = JSONObject.parseObject(EntityUtils.toString(responseEntity)); +// String contents = jsonObject.getString("contents"); +// JSONObject contentsObject = JSONObject.parseObject(contents); +// String userToken = contentsObject.getString("userToken"); +// String verifyStatus = contentsObject.getString("verifyStatus"); +// +// } +// } catch (ClientProtocolException e) { +// e.printStackTrace(); +// } catch (IOException e) { +// e.printStackTrace(); +// } finally { +// try { +// // 释放资源 +// if (httpClient != null) { +// httpClient.close(); +// } +// if (response != null) { +// response.close(); +// } +// } catch (IOException e) { +// e.printStackTrace(); +// } +// return jsonObject; +// } +// +// //return jsonObject; +// } + /* * 单点登录 diff --git a/power-admin/src/main/webapp/WEB-INF/views/loginDir/login.jsp b/power-admin/src/main/webapp/WEB-INF/views/loginDir/login.jsp index a6adc7f..41d7fc2 100644 --- a/power-admin/src/main/webapp/WEB-INF/views/loginDir/login.jsp +++ b/power-admin/src/main/webapp/WEB-INF/views/loginDir/login.jsp @@ -50,8 +50,11 @@