|
@@ -1,5 +1,7 @@
|
|
package cn.com.qmth.examcloud.service.core.service;
|
|
package cn.com.qmth.examcloud.service.core.service;
|
|
|
|
|
|
|
|
+import static org.springframework.data.domain.ExampleMatcher.GenericPropertyMatchers.contains;
|
|
|
|
+
|
|
import java.util.Date;
|
|
import java.util.Date;
|
|
import java.util.HashSet;
|
|
import java.util.HashSet;
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
@@ -18,7 +20,6 @@ import org.springframework.stereotype.Service;
|
|
|
|
|
|
import cn.com.qmth.examcloud.common.uac.AccessCtrlUtil;
|
|
import cn.com.qmth.examcloud.common.uac.AccessCtrlUtil;
|
|
import cn.com.qmth.examcloud.common.uac.entity.AccessUser;
|
|
import cn.com.qmth.examcloud.common.uac.entity.AccessUser;
|
|
-import cn.com.qmth.examcloud.common.util.ErrorMsg;
|
|
|
|
import cn.com.qmth.examcloud.common.util.RedisUtil;
|
|
import cn.com.qmth.examcloud.common.util.RedisUtil;
|
|
import cn.com.qmth.examcloud.service.core.dto.UserInfo;
|
|
import cn.com.qmth.examcloud.service.core.dto.UserInfo;
|
|
import cn.com.qmth.examcloud.service.core.entity.Org;
|
|
import cn.com.qmth.examcloud.service.core.entity.Org;
|
|
@@ -32,8 +33,6 @@ import cn.com.qmth.examcloud.service.core.repo.StudentRepo;
|
|
import cn.com.qmth.examcloud.service.core.repo.UserRepo;
|
|
import cn.com.qmth.examcloud.service.core.repo.UserRepo;
|
|
import cn.com.qmth.examcloud.service.core.repo.UserRoleRepo;
|
|
import cn.com.qmth.examcloud.service.core.repo.UserRoleRepo;
|
|
|
|
|
|
-import static org.springframework.data.domain.ExampleMatcher.GenericPropertyMatchers.contains;
|
|
|
|
-
|
|
|
|
/**
|
|
/**
|
|
* 用户服务类
|
|
* 用户服务类
|
|
* Created by songyue on 17/1/13.
|
|
* Created by songyue on 17/1/13.
|
|
@@ -119,9 +118,11 @@ public class UserService {
|
|
public ResponseEntity loginProcess(User user,
|
|
public ResponseEntity loginProcess(User user,
|
|
String password){
|
|
String password){
|
|
if(user == null){
|
|
if(user == null){
|
|
- return new ResponseEntity(new ErrorMsg("该用户不存在"),HttpStatus.NOT_FOUND);
|
|
|
|
|
|
+ new RuntimeException("该用户不存在");
|
|
|
|
+ return null;
|
|
}else if(!user.getPassword().equals(password)){
|
|
}else if(!user.getPassword().equals(password)){
|
|
- return new ResponseEntity(new ErrorMsg("密码错误"),HttpStatus.EXPECTATION_FAILED);
|
|
|
|
|
|
+ new RuntimeException("密码错误");
|
|
|
|
+ return null;
|
|
}else{
|
|
}else{
|
|
String token = AccessCtrlUtil.buildToken();
|
|
String token = AccessCtrlUtil.buildToken();
|
|
createAccessUser(token,user,null);
|
|
createAccessUser(token,user,null);
|