|
@@ -99,7 +99,7 @@ public class TokenLoginController extends BaseController {
|
|
|
fljg.setU(userInfo.getId());
|
|
|
orgList.add(fljg);
|
|
|
for (SysUserInfo sonUser : sonList) {
|
|
|
- Organization sonOrg = organizationService.selectByPrimaryKey(userInfo.getGroupId());
|
|
|
+ Organization sonOrg = organizationService.selectByPrimaryKey(sonUser.getGroupId());
|
|
|
sonOrg.setU(sonUser.getId());
|
|
|
orgList.add(sonOrg);
|
|
|
}
|
|
@@ -109,26 +109,8 @@ public class TokenLoginController extends BaseController {
|
|
|
view.setViewName("checkOrg");
|
|
|
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
|
|
|
Subject subject = SecurityUtils.getSubject();
|
|
|
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
|
|
@@ -187,7 +141,6 @@ public class TokenLoginController extends BaseController {
|
|
|
*/
|
|
|
private LoginUser getPtUser(String token,String wl){
|
|
|
LoginUser loginUser = null;
|
|
|
-
|
|
|
String url = TyrzptConstants.N_URL+TyrzptConstants.GET_USER+"?token="+token;
|
|
|
|
|
|
//发送请求
|
|
@@ -208,7 +161,6 @@ public class TokenLoginController extends BaseController {
|
|
|
loginUser = new LoginUser();
|
|
|
loginUser.setCode("202");
|
|
|
loginUser.setMsg("用户登录失败");
|
|
|
-
|
|
|
} else {
|
|
|
JSONObject jdata = jsonO.getJSONObject("data");
|
|
|
Map<String, Object> dataMap = (Map<String, Object>) JSON.parse(jdata.toString());
|
|
@@ -219,8 +171,6 @@ public class TokenLoginController extends BaseController {
|
|
|
return loginUser;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
/**
|
|
|
* 返回主页
|
|
|
* @param wl
|
|
@@ -243,8 +193,6 @@ public class TokenLoginController extends BaseController {
|
|
|
return new ModelAndView("error/202");
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
@Override
|
|
|
public String getPagePath() {
|
|
|
return null;
|