初始化

master
linjj 1 year ago
parent 12cd3e63f9
commit 9152a3ad0d

@ -598,28 +598,19 @@ public class FontController {
@RequestMapping(value="getQRcode") @RequestMapping(value="getQRcode")
@ResponseBody @ResponseBody
public QrBean getQRcode(QRcode qRcode, HttpServletRequest request){ public QrBean getQRcode(QRcode qRcode, HttpServletRequest request){
// 获得Http客户端 // 获得Http客户端
CloseableHttpClient httpClient = HttpClientBuilder.create().build(); CloseableHttpClient httpClient = HttpClientBuilder.create().build();
// 创建Post请求 // 创建Post请求
HttpPost httpPost = new HttpPost("http://192.168.1.212:8080/cloudkeyserver/api/login/qrcode/nostatus/2CKV1"); HttpPost httpPost = new HttpPost("http://192.168.1.212:8080/cloudkeyserver/api/login/qrcode/nostatus/2CKV1");
// qRcode.setLoginTypeBitValue(16);
// qRcode.setType(3);
// qRcode.setProjectUid("cloudkey-fstth");
// qRcode.setApplicationId("fstth-wzh");
System.out.println("qRcode:::::"+qRcode.getApplicationId());
//json格式转换 //json格式转换
String jsonString = JSON.toJSONString(qRcode); String jsonString = JSON.toJSONString(qRcode);
System.out.println("jsonString1::::"+jsonString);
StringEntity entity = new StringEntity(jsonString, "UTF-8"); StringEntity entity = new StringEntity(jsonString, "UTF-8");
System.out.println("jsonString::::"+jsonString);
// post请求是将参数放在请求体里面传过去的;这里将entity放入post请求体中 // post请求是将参数放在请求体里面传过去的;这里将entity放入post请求体中
httpPost.setEntity(entity); httpPost.setEntity(entity);
httpPost.setHeader("Content-Type", "application/json;charset=utf8"); httpPost.setHeader("Content-Type", "application/json;charset=utf8");
// 响应模型 // 响应模型
CloseableHttpResponse response = null; CloseableHttpResponse response = null;
HttpEntity responseEntity=null; HttpEntity responseEntity=null;
String s ="";
QrBean qrBean=new QrBean(); QrBean qrBean=new QrBean();
try { try {
// 由客户端执行(发送)Post请求 // 由客户端执行(发送)Post请求
@ -635,11 +626,8 @@ public class FontController {
String qrCodeIdentity = contentsObject.getString("qrCodeIdentity"); String qrCodeIdentity = contentsObject.getString("qrCodeIdentity");
JSONArray qrCodes = contentsObject.getJSONArray("qrCodes"); JSONArray qrCodes = contentsObject.getJSONArray("qrCodes");
String qrCodeBase64 = qrCodes.getJSONObject(0).get("qrCodeBase64").toString(); String qrCodeBase64 = qrCodes.getJSONObject(0).get("qrCodeBase64").toString();
qrBean.setQrCodeBase64(qrCodeBase64); qrBean.setQrCodeBase64(qrCodeBase64);
qrBean.setQrCodeIdentity(qrCodeIdentity); qrBean.setQrCodeIdentity(qrCodeIdentity);
System.out.println("qrBean::::"+qrBean.getQrCodeIdentity());
} }
} catch (ClientProtocolException e) { } catch (ClientProtocolException e) {
e.printStackTrace(); e.printStackTrace();
@ -671,7 +659,6 @@ public class FontController {
@RequestMapping(value="getScanCode") @RequestMapping(value="getScanCode")
@ResponseBody @ResponseBody
public ScanCodeRes getQRcode(ScanCode scanCode, HttpServletRequest request){ public ScanCodeRes getQRcode(ScanCode scanCode, HttpServletRequest request){
System.out.println("scanCode123::::"+scanCode.getQrCodeIdentity());
// 获得Http客户端 // 获得Http客户端
CloseableHttpClient httpClient = HttpClientBuilder.create().build(); CloseableHttpClient httpClient = HttpClientBuilder.create().build();
// 创建Post请求 // 创建Post请求
@ -797,23 +784,11 @@ public class FontController {
public Msg qRCodeLogin(Power_User powerUser, HttpServletResponse response, HttpServletRequest request, Model model){ public Msg qRCodeLogin(Power_User powerUser, HttpServletResponse response, HttpServletRequest request, Model model){
try { try {
Power_UserVo user = power_userService.findUserName(powerUser); Power_UserVo user = power_userService.findUserName(powerUser);
System.out.println("user:::::"+user);
//添加进操作日志 //添加进操作日志
Power_Log log = new Power_Log(); Power_Log log = new Power_Log();
if(user != null){ if(user != null){
// //存session密码置空
//// //是否记住密码功能
//// MyCookieUtil.remember(request, response);
//设置token缓存
String token = UUID.randomUUID().toString(); String token = UUID.randomUUID().toString();
//查询归属医院 //查询归属医院
/*long start5 = System.currentTimeMillis();
Power_User_Dict powerUserDict = powerUserDictMapper.selectDictIdByUserId(user.getUserId());
long end5 = System.currentTimeMillis();
System.out.println("查询医院时间="+(end5-start5)/1000.0+"s");
user.setDictId(powerUserDict.getDictId());*/
//设置用户登录次数缓存
//CacheManager.addloginUserCount(fmt.format(new Date()),user.getUserName());
CacheManager.addExcCount("noExc"); CacheManager.addExcCount("noExc");
List<Power_Menu> list = null; List<Power_Menu> list = null;
List<User_Dept_Menu> menuList = new ArrayList<>(); List<User_Dept_Menu> menuList = new ArrayList<>();
@ -867,10 +842,6 @@ public class FontController {
url = "http://"+ip+":"+POWER_PORT+"/power/gatewayPage"; url = "http://"+ip+":"+POWER_PORT+"/power/gatewayPage";
} }
//request.getRequestDispatcher(url).forward(request, response);
//response.sendRedirect(url);
//return "redirect:gatewayPage";
return Msg.success().add("url",url); return Msg.success().add("url",url);
}else{ }else{
//登录失败 //登录失败

@ -69,7 +69,13 @@ public class LoginController {
@ResponseBody @ResponseBody
public Msg login(Power_User powerUser,HttpServletResponse response, HttpServletRequest request,Model model){ public Msg login(Power_User powerUser,HttpServletResponse response, HttpServletRequest request,Model model){
try { try {
String userName = powerUser.getUserName();
if (!userName.equals("admin")){
String s ="00" + userName;
powerUser.setUserName(s);
}
Power_UserVo user = powerUserService.findPowerUserByUserNameAndUserPwd(powerUser); Power_UserVo user = powerUserService.findPowerUserByUserNameAndUserPwd(powerUser);
//添加进操作日志 //添加进操作日志
Power_Log log = new Power_Log(); Power_Log log = new Power_Log();
if(user != null){ if(user != null){
@ -78,14 +84,6 @@ public class LoginController {
MyCookieUtil.remember(request, response); MyCookieUtil.remember(request, response);
//设置token缓存 //设置token缓存
String token = UUID.randomUUID().toString(); String token = UUID.randomUUID().toString();
//查询归属医院
/*long start5 = System.currentTimeMillis();
Power_User_Dict powerUserDict = powerUserDictMapper.selectDictIdByUserId(user.getUserId());
long end5 = System.currentTimeMillis();
System.out.println("查询医院时间="+(end5-start5)/1000.0+"s");
user.setDictId(powerUserDict.getDictId());*/
//设置用户登录次数缓存
//CacheManager.addloginUserCount(fmt.format(new Date()),user.getUserName());
CacheManager.addExcCount("noExc"); CacheManager.addExcCount("noExc");
List<Power_Menu> list = null; List<Power_Menu> list = null;
List<User_Dept_Menu> menuList = new ArrayList<>(); List<User_Dept_Menu> menuList = new ArrayList<>();
@ -162,6 +160,7 @@ public class LoginController {
log.setRemark("已错误【"+wrongNum+"】次"); log.setRemark("已错误【"+wrongNum+"】次");
logService.insert(log); logService.insert(log);
request.setAttribute("msg", "用户名或密码不正确"); request.setAttribute("msg", "用户名或密码不正确");
return Msg.failUser();
} }
}catch (Exception e){ }catch (Exception e){
e.printStackTrace(); e.printStackTrace();

@ -153,9 +153,6 @@ public class SsoLogin {
// 把json字符串转换成json对象 // 把json字符串转换成json对象
JSONObject jsonResult = JSONObject.parseObject(returnResult); JSONObject jsonResult = JSONObject.parseObject(returnResult);
if (jsonResult != null) { if (jsonResult != null) {
/*if((jsonResult.getString("username"))!=null&&!"".equals(jsonResult.getString("username"))) {
userName=jsonResult.getString("username");
}*/
if ((jsonResult.getString("name")) != null && !"".equals(jsonResult.getString("name"))) { if ((jsonResult.getString("name")) != null && !"".equals(jsonResult.getString("name"))) {
//接口返回的登录名为4位我们系统为6位接口登录名前追加两个0变成我们的6位 //接口返回的登录名为4位我们系统为6位接口登录名前追加两个0变成我们的6位
userName = "00" + jsonResult.getString("name"); userName = "00" + jsonResult.getString("name");
@ -230,6 +227,7 @@ public class SsoLogin {
} }
return result; return result;
} }
@RequestMapping(value = "into", method = RequestMethod.GET, produces = "text/html;charset=utf-8") @RequestMapping(value = "into", method = RequestMethod.GET, produces = "text/html;charset=utf-8")
@ResponseBody @ResponseBody
public void in(HttpServletRequest request, HttpServletResponse response) { public void in(HttpServletRequest request, HttpServletResponse response) {

@ -23,11 +23,11 @@ POWER_PORT = ${SERVER_PORT}
#\u75C5\u6848\u5F52\u6863\u7CFB\u7EDFip #\u75C5\u6848\u5F52\u6863\u7CFB\u7EDFip
EMRMEDICALRECORD_IP = ${SERVER_IP} EMRMEDICALRECORD_IP = ${SERVER_IP}
#\u75C5\u6848\u5F52\u6863\u7CFB\u7EDF\u7AEF\u53E3 #\u75C5\u6848\u5F52\u6863\u7CFB\u7EDF\u7AEF\u53E3
EMRMEDICALRECORD_PORT = ${SERVER_PORT} EMRMEDICALRECORD_PORT = 8084
#\u75C5\u6848\u7BA1\u7406\u7CFB\u7EDFip #\u75C5\u6848\u7BA1\u7406\u7CFB\u7EDFip
EMRRECORD_IP = ${SERVER_IP} EMRRECORD_IP = ${SERVER_IP}
#\u75C5\u6848\u7BA1\u7406\u7CFB\u7EDF\u7AEF\u53E3 #\u75C5\u6848\u7BA1\u7406\u7CFB\u7EDF\u7AEF\u53E3
EMRRECORD_PORT = ${SERVER_PORT} EMRRECORD_PORT = 8083
#\u75C5\u6848\u590D\u5370\u9884\u7EA6ip #\u75C5\u6848\u590D\u5370\u9884\u7EA6ip
EMRAPPLYCOPY_IP = ${SERVER_IP} EMRAPPLYCOPY_IP = ${SERVER_IP}

@ -1,11 +1,17 @@
#jdbc.url=jdbc\:mysql\://200.100.104.40\:3306/power?useUnicode\=true&characterEncoding\=utf-8 #jdbc.url=jdbc\:mysql\://200.100.104.40\:3306/power?useUnicode\=true&characterEncoding\=utf-8
#jdbc.password=AbcXyz123 #jdbc.password=AbcXyz123
jdbc.url=jdbc\:mysql\://localhost\:3306/gmpower?useUnicode\=true&characterEncoding\=utf-8 dataBaseIp=10.100.23.103
jdbc.password=docus702 #\u6570\u636E\u5E93\u540D\u79F0
dataBaseName=power
jdbc.driver=com.mysql.jdbc.Driver \u6570\u636E\u5E93\u8D26\u53F7
jdbc.username=root dataBaseUserName=power
#\u6570\u636E\u5E93\u5BC6\u7801
dataBasePassword=power@fstth
jdbc.url=jdbc\:mysql\://${dataBaseIp}\:3346/${dataBaseName}?useUnicode\=true&characterEncoding\=utf-8&useSSL\=false&serverTimeZone\=Shanghai
jdbc.username=${dataBaseUserName}
jdbc.password=${dataBasePassword}
jdbc.driver=com.mysql.cj.jdbc.Driver
filters: stat filters: stat
maxActive: 20 maxActive: 20

@ -83,7 +83,6 @@
</div> </div>
<div class="inputDiv"> <div class="inputDiv">
<button class="btn btn-success btn-block" onclick="handoffLogin2()">账号密码登录</button> <button class="btn btn-success btn-block" onclick="handoffLogin2()">账号密码登录</button>
<p class="text-danger">${msg}</p>
</div> </div>
</div> </div>
</div> </div>

@ -218,7 +218,7 @@
return item[field]; return item[field];
} }
var props = field.split('.'); var props = field.split('.');
// 在IE8 中 for...in 会将方法也枚举出来 使用 for loop // <EFBFBD><EFBFBD>IE8 <20><> for...in <20><EFBFBD><E1BDAB><EFBFBD><EFBFBD>Ҳö<D2B2>ٳ<EFBFBD><D9B3><EFBFBD> ʹ<><CAB9> for loop
// for (var p in props) { // for (var p in props) {
// value = value[props[p]]; // value = value[props[p]];
// } // }
@ -1247,8 +1247,8 @@
html.push('</span>'); html.push('</span>');
html.push( html.push(
'<div class="goPage"><input type="button" value="跳转" class="pageBtn" onclick="toPage();"></div>', '<div class="goPage"><input type="button" value="<EFBFBD><EFBFBD>ת" class="pageBtn" onclick="toPage();"></div>',
'<div class="goPage">跳转到第<input id="pageNum" class="pageNum" type="number">页</div>', '<div class="goPage"><EFBFBD><EFBFBD>ת<EFBFBD><EFBFBD><EFBFBD><EFBFBD><input id="pageNum" class="pageNum" type="number">ҳ</div>',
'</div>', '</div>',
'<div class="pull-' + this.options.paginationHAlign + ' pagination">', '<div class="pull-' + this.options.paginationHAlign + ' pagination">',
'<ul class="pagination' + (this.options.iconSize === undefined ? '' : ' pagination-' + this.options.iconSize) + '">', '<ul class="pagination' + (this.options.iconSize === undefined ? '' : ' pagination-' + this.options.iconSize) + '">',
@ -2087,7 +2087,7 @@
if (this.options.showHeader && this.options.height) { if (this.options.showHeader && this.options.height) {
this.$tableHeader.show(); this.$tableHeader.show();
// // bootstrap-table 表头数据展示错位问题 // // bootstrap-table <EFBFBD><EFBFBD>ͷ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>չʾ<EFBFBD><EFBFBD>λ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
this.resetHeader(); this.resetHeader();
// padding += this.$header.outerHeight(); // padding += this.$header.outerHeight();
} else { } else {

@ -1,6 +1,3 @@
/** /**
* Created by ljx on 2019/4/25. * Created by ljx on 2019/4/25.
*/ */
@ -59,7 +56,7 @@ function login(){
if (data.code == 100) { if (data.code == 100) {
window.location.href = data.extend.url; window.location.href = data.extend.url;
} else { } else {
$("#msg").text(data.msg); alert(data.msg)
} }
} }
}) })
@ -70,6 +67,8 @@ function login(){
var interval = ""; var interval = "";
var qrCodeIdentity = ""; var qrCodeIdentity = "";
//获取扫码登录二维码
function handoffLogin() { function handoffLogin() {
$.ajax({ $.ajax({
type: "POST", type: "POST",
@ -78,6 +77,7 @@ var qrCodeIdentity ="";
success: function (data) { success: function (data) {
qrCodeIdentity = data.qrCodeIdentity; qrCodeIdentity = data.qrCodeIdentity;
$("#QRcordImg").prop("src", "data:image/jpeg;base64," + data.qrCodeBase64); $("#QRcordImg").prop("src", "data:image/jpeg;base64," + data.qrCodeBase64);
//轮询监听用户扫码
interval = setInterval(scanCodeLogin, 1000, qrCodeIdentity); interval = setInterval(scanCodeLogin, 1000, qrCodeIdentity);
} }
@ -95,6 +95,7 @@ function scanCodeLogin() {
url: path + '/font/getScanCode', url: path + '/font/getScanCode',
success: function (body) { success: function (body) {
if (body.verifyStatus == 0) { if (body.verifyStatus == 0) {
//扫码认证成功后撤销监听
clearInterval(interval); clearInterval(interval);
$.ajax({ $.ajax({
type: "POST", type: "POST",
@ -127,9 +128,6 @@ function scanCodeLogin() {
} }
function handoffLogin2() { function handoffLogin2() {
$("#switchHandoff").css("display", "block"); $("#switchHandoff").css("display", "block");

@ -35,6 +35,14 @@ public class Msg {
return result; return result;
} }
public static Msg failUser(){
Msg result=new Msg();
result.setCode(200);
result.setMsg("账号或密码错误");
return result;
}
public static Msg fail(String msg){ public static Msg fail(String msg){
Msg result=new Msg(); Msg result=new Msg();
result.setCode(200); result.setCode(200);

Loading…
Cancel
Save