Commit 64692c521aeec1fe3d8b272b96274e0f8511975a

Authored by rui.zhang
1 parent cb0caa28d3

platform permission

用户登录

Showing 2 changed files with 5 additions and 8 deletions

platform-common/src/main/java/com/lyms/platform/common/utils/LoginUtil.java View file @ 64692c5
... ... @@ -83,9 +83,7 @@
83 83 LoginContext loginState = new LoginContext();
84 84 if (200 == statusCode) {
85 85 loginState = JsonUtil.str2Obj(result, LoginContext.class);
86   - if (0 == loginState.getErrorcode()) {
87   - return loginState;
88   - }
  86 + return loginState;
89 87 }
90 88 } catch (Exception e) {
91 89 e.printStackTrace();
... ... @@ -112,9 +110,7 @@
112 110 LoginContext loginState = new LoginContext();
113 111 if (200 == statusCode) {
114 112 loginState = JsonUtil.str2Obj(result, LoginContext.class);
115   - if (0 == loginState.getErrorcode()) {
116   - return loginState;
117   - }
  113 + return loginState;
118 114 }
119 115 } catch (Exception e) {
120 116 e.printStackTrace();
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/UsersController.java View file @ 64692c5
... ... @@ -198,7 +198,8 @@
198 198 return;
199 199 }
200 200  
201   - LoginContext loginContext = null;
  201 + LoginContext loginContext = new LoginContext();
  202 + loginContext.setErrormsg("服务器内部错误!");
202 203 if(null != code) {
203 204 loginContext =LoginUtil.login(account, code, typeId, token);
204 205 }
... ... @@ -206,7 +207,7 @@
206 207 loginContext = LoginUtil.loginHospitalUser(account, password, typeId, token);
207 208 }
208 209  
209   - if(null != loginContext) {
  210 + if(null != loginContext && loginContext.getErrorcode().equals(0)) {
210 211 Users users1 = new Users();
211 212 users1.setId(users.get(0).getId());
212 213 users1.setLastLoginTime(new Date());