|
@@ -99,7 +99,7 @@ public class TokenLoginController extends BaseController {
|
|
fljg.setU(userInfo.getId());
|
|
fljg.setU(userInfo.getId());
|
|
orgList.add(fljg);
|
|
orgList.add(fljg);
|
|
for (SysUserInfo sonUser : sonList) {
|
|
for (SysUserInfo sonUser : sonList) {
|
|
- Organization sonOrg = organizationService.selectByPrimaryKey(userInfo.getGroupId());
|
|
|
|
|
|
+ Organization sonOrg = organizationService.selectByPrimaryKey(sonUser.getGroupId());
|
|
sonOrg.setU(sonUser.getId());
|
|
sonOrg.setU(sonUser.getId());
|
|
orgList.add(sonOrg);
|
|
orgList.add(sonOrg);
|
|
}
|
|
}
|
|
@@ -109,26 +109,8 @@ public class TokenLoginController extends BaseController {
|
|
view.setViewName("checkOrg");
|
|
view.setViewName("checkOrg");
|
|
return view;
|
|
return view;
|
|
}
|
|
}
|
|
-
|
|
|
|
-
|
|
|
|
-// //如果同一账号绑定多个机构 跳转选择机构页面
|
|
|
|
-// if (userInfo.getOrgids() != null && userInfo.getOrgids().split(",").length>1){
|
|
|
|
-// String[] strings = userInfo.getOrgids().split(",");
|
|
|
|
-// Integer[] idsArr = new Integer[strings.length];
|
|
|
|
-// for (int i=0;i<strings.length;i++){
|
|
|
|
-// idsArr[i] = Integer.valueOf(strings[i]);
|
|
|
|
-// }
|
|
|
|
-// List<Organization> orgList = organizationService.selectByIds(idsArr);
|
|
|
|
-// view.addObject("orgList",orgList);
|
|
|
|
-// view.addObject("tyyhid",loginUser.getTyyhId());
|
|
|
|
-// view.addObject("token",token);
|
|
|
|
-// view.addObject("wl",wl);
|
|
|
|
-// view.setViewName("checkOrg");
|
|
|
|
-// return view;
|
|
|
|
-// }
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
//shiro
|
|
//shiro
|
|
Subject subject = SecurityUtils.getSubject();
|
|
Subject subject = SecurityUtils.getSubject();
|
|
UsernamePasswordToken t = new UsernamePasswordToken(userInfo.getAccount(), userInfo.getPassword());
|
|
UsernamePasswordToken t = new UsernamePasswordToken(userInfo.getAccount(), userInfo.getPassword());
|
|
@@ -152,34 +134,6 @@ public class TokenLoginController extends BaseController {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- /**
|
|
|
|
- * checkOrg
|
|
|
|
- * @param tyyhid
|
|
|
|
- * @return
|
|
|
|
- * @throws Exception
|
|
|
|
- */
|
|
|
|
- @Log(operationType = OperationType.TOKEN_LOGIN , title = "选择登陆机构")
|
|
|
|
- @RequestMapping(value = "/checkOrg", method = RequestMethod.GET)
|
|
|
|
- public ModelAndView checkOrg(String tyyhid,Integer orgid) {
|
|
|
|
- SysUserInfo userInfo = service.checkByTyyhId(tyyhid);
|
|
|
|
- userInfo.setGroupId(orgid);
|
|
|
|
- //shiro
|
|
|
|
- Subject subject = SecurityUtils.getSubject();
|
|
|
|
- UsernamePasswordToken t = new UsernamePasswordToken(userInfo.getAccount(), userInfo.getPassword());
|
|
|
|
- subject.login(t);
|
|
|
|
- // 生成session
|
|
|
|
- setSysUserInfo(userInfo);
|
|
|
|
- ModelAndView view = new ModelAndView();
|
|
|
|
- view.addObject("title", title);
|
|
|
|
- view.addObject("copyright", copyright);
|
|
|
|
- view.setViewName("main");
|
|
|
|
- return view;
|
|
|
|
-// BaseParameter result = new BaseParameter();
|
|
|
|
-// result.commit();
|
|
|
|
-// return result.toString();
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
-
|
|
|
|
/**
|
|
/**
|
|
* 调用用户认证平台接口,获取用户信息
|
|
* 调用用户认证平台接口,获取用户信息
|
|
* @param token
|
|
* @param token
|
|
@@ -187,7 +141,6 @@ public class TokenLoginController extends BaseController {
|
|
*/
|
|
*/
|
|
private LoginUser getPtUser(String token,String wl){
|
|
private LoginUser getPtUser(String token,String wl){
|
|
LoginUser loginUser = null;
|
|
LoginUser loginUser = null;
|
|
-
|
|
|
|
String url = TyrzptConstants.N_URL+TyrzptConstants.GET_USER+"?token="+token;
|
|
String url = TyrzptConstants.N_URL+TyrzptConstants.GET_USER+"?token="+token;
|
|
|
|
|
|
//发送请求
|
|
//发送请求
|
|
@@ -208,7 +161,6 @@ public class TokenLoginController extends BaseController {
|
|
loginUser = new LoginUser();
|
|
loginUser = new LoginUser();
|
|
loginUser.setCode("202");
|
|
loginUser.setCode("202");
|
|
loginUser.setMsg("用户登录失败");
|
|
loginUser.setMsg("用户登录失败");
|
|
-
|
|
|
|
} else {
|
|
} else {
|
|
JSONObject jdata = jsonO.getJSONObject("data");
|
|
JSONObject jdata = jsonO.getJSONObject("data");
|
|
Map<String, Object> dataMap = (Map<String, Object>) JSON.parse(jdata.toString());
|
|
Map<String, Object> dataMap = (Map<String, Object>) JSON.parse(jdata.toString());
|
|
@@ -219,8 +171,6 @@ public class TokenLoginController extends BaseController {
|
|
return loginUser;
|
|
return loginUser;
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
-
|
|
|
|
/**
|
|
/**
|
|
* 返回主页
|
|
* 返回主页
|
|
* @param wl
|
|
* @param wl
|
|
@@ -243,8 +193,6 @@ public class TokenLoginController extends BaseController {
|
|
return new ModelAndView("error/202");
|
|
return new ModelAndView("error/202");
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
-
|
|
|
|
@Override
|
|
@Override
|
|
public String getPagePath() {
|
|
public String getPagePath() {
|
|
return null;
|
|
return null;
|