|
@@ -74,7 +74,7 @@ public class UserService {
|
|
public ResponseEntity login(String loginName,
|
|
public ResponseEntity login(String loginName,
|
|
String password){
|
|
String password){
|
|
User user = userRepo.findByLoginName(loginName);
|
|
User user = userRepo.findByLoginName(loginName);
|
|
- return loginProcess(user,password,null);
|
|
|
|
|
|
+ return loginProcess(user,password);
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
@@ -89,7 +89,7 @@ public class UserService {
|
|
String loginName,
|
|
String loginName,
|
|
String password){
|
|
String password){
|
|
User user = userRepo.findByRootOrgIdAndLoginName(orgId,loginName);
|
|
User user = userRepo.findByRootOrgIdAndLoginName(orgId,loginName);
|
|
- return loginProcess(user,password,null);
|
|
|
|
|
|
+ return loginProcess(user,password);
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -99,15 +99,15 @@ public class UserService {
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
public ResponseEntity loginProcess(User user,
|
|
public ResponseEntity loginProcess(User user,
|
|
- String password,Long studentId){
|
|
|
|
|
|
+ String password){
|
|
if(user == null){
|
|
if(user == null){
|
|
return new ResponseEntity(new ErrorMsg("该用户不存在"),HttpStatus.NOT_FOUND);
|
|
return new ResponseEntity(new ErrorMsg("该用户不存在"),HttpStatus.NOT_FOUND);
|
|
}else if(!user.getPassword().equals(password)){
|
|
}else if(!user.getPassword().equals(password)){
|
|
return new ResponseEntity(new ErrorMsg("密码错误"),HttpStatus.EXPECTATION_FAILED);
|
|
return new ResponseEntity(new ErrorMsg("密码错误"),HttpStatus.EXPECTATION_FAILED);
|
|
}else{
|
|
}else{
|
|
String token = AccessCtrlUtil.buildToken();
|
|
String token = AccessCtrlUtil.buildToken();
|
|
- createAccessUser(token,user,studentId);
|
|
|
|
- return new ResponseEntity(getUserInfo(user,token,studentId),HttpStatus.OK);
|
|
|
|
|
|
+ createAccessUser(token,user,null);
|
|
|
|
+ return new ResponseEntity(getUserInfo(user,token),HttpStatus.OK);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -138,7 +138,7 @@ public class UserService {
|
|
* @param token
|
|
* @param token
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
- public UserInfo getUserInfo(User user,String token,Long studentId){
|
|
|
|
|
|
+ public UserInfo getUserInfo(User user,String token){
|
|
UserInfo userInfo = new UserInfo();
|
|
UserInfo userInfo = new UserInfo();
|
|
Org org = orgRepo.findOne(user.getOrgId());
|
|
Org org = orgRepo.findOne(user.getOrgId());
|
|
Org rootOrg = orgRepo.findOne(user.getRootOrgId());
|
|
Org rootOrg = orgRepo.findOne(user.getRootOrgId());
|