| | |
| | | SpObserver.setDBtoInstance("_" + webSession.getDbId()); |
| | | //删除二维码 |
| | | webSocketqrCodeIfc.delExpireQrCode(webSession.getQrCode()); |
| | | }finally { |
| | | } finally { |
| | | SpObserver.setDBtoInstance(); |
| | | } |
| | | for (WebSession ws : sessionList) { |
| | |
| | | if (info.getUsercode() != null && info.getUsercode().length() > 30) {// 解密为明文 |
| | | info.setUsercode(ChangePassword.getDecryptPassword(EncodeUtil.replaceUrlChar(info.getUsercode()))); |
| | | } |
| | | SpObserver.setDBtoInstance("_" + info.getDbid()); |
| | | UserAccountEntity userAccount = userAccountService.getUserInfoByTelephone(info.getUsercode()); |
| | | UserAccountEntity userAccount = null; |
| | | try { |
| | | SpObserver.setDBtoInstance("_" + info.getDbid()); |
| | | userAccount = userAccountService.getUserInfoByTelephone(info.getUsercode()); |
| | | } finally { |
| | | SpObserver.setDBtoInstance(); |
| | | } |
| | | if (userAccount != null) { |
| | | if (userAccount.isInActive()) { |
| | | for (WebSession web : sessionList) { |
| | |
| | | } |
| | | return; |
| | | } |
| | | //认证成功后给app端返回信息(pc端要在下面写入会话中后在返回) |
| | | for (WebSession web : sessionList) { |
| | | if (web.getState() != 0) { |
| | | getMessage(web.getSession(), 2, "认证成功"); |
| | | } |
| | | } |
| | | WebSession webPC = null;//pc页面的对象 |
| | | for (WebSession web : sessionList) { |
| | | if (web.getState() == 0 && web.getHttpSession() != null) { |
| | | webPC = web;//获取是pc页面的对象 |
| | | } |
| | | } |
| | | //认证成功后给app端返回信息(pc端要在下面写入会话中后在返回) |
| | | for (WebSession web : sessionList) { |
| | | if (web.getState() != 0) { |
| | | getMessage(web.getSession(), 2, "认证成功"); |
| | | } |
| | | } |
| | | if (webPC != null) {//pc登录处理 |
| | | // 保存会话 session信息 |
| | | LoginAction loginAction = (LoginAction) FactoryBean.getBean("loginAction"); |
| | | boolean bol = loginAction.processLoginUserToSession("", info.getDbid() + "", webPC.getHttpSession(), |
| | | userAccount); |
| | | if (bol) { |
| | | //返回信息给PC端 |
| | | getMessage(webPC.getSession(), 2, "登录成功"); |
| | | LoginQRCodeWS.deleteWebSession(webPC.getQrCode());//成功后删除 |
| | | synchronized (this) { |
| | | // 保存会话 session信息 |
| | | LoginAction loginAction = (LoginAction) FactoryBean.getBean("loginAction"); |
| | | boolean bol = loginAction.processLoginUserToSession("", info.getDbid() + "", webPC.getHttpSession(), userAccount); |
| | | if (bol) { |
| | | //返回信息给PC端 |
| | | getMessage(webPC.getSession(), 2, "登录成功"); |
| | | LoginQRCodeWS.deleteWebSession(webPC.getQrCode());//成功后删除 |
| | | } |
| | | } |
| | | } |
| | | } else { |
| | |
| | | for (WebSession web : sessionList) { |
| | | getMessage(web.getSession(), -1, (e.getCause() != null ? e.getCause().getMessage() : e.getMessage())); |
| | | } |
| | | } finally { |
| | | SpObserver.setDBtoInstance(); |
| | | } |
| | | } |
| | | |