|
@@ -16,6 +16,8 @@ import cn.com.qmth.examcloud.commons.base.exception.StatusException;
|
|
import cn.com.qmth.examcloud.commons.base.util.PropertiesUtil;
|
|
import cn.com.qmth.examcloud.commons.base.util.PropertiesUtil;
|
|
import cn.com.qmth.examcloud.commons.web.security.bean.User;
|
|
import cn.com.qmth.examcloud.commons.web.security.bean.User;
|
|
import cn.com.qmth.examcloud.commons.web.support.ControllerSupport;
|
|
import cn.com.qmth.examcloud.commons.web.support.ControllerSupport;
|
|
|
|
+import cn.com.qmth.examcloud.commons.web.support.ResponseStatus;
|
|
|
|
+import cn.com.qmth.examcloud.commons.web.support.StatusResponseEntity;
|
|
import cn.com.qmth.examcloud.core.basic.base.constants.PropKeys;
|
|
import cn.com.qmth.examcloud.core.basic.base.constants.PropKeys;
|
|
import cn.com.qmth.examcloud.core.basic.dao.StudentRepo;
|
|
import cn.com.qmth.examcloud.core.basic.dao.StudentRepo;
|
|
import cn.com.qmth.examcloud.core.basic.dao.entity.StudentEntity;
|
|
import cn.com.qmth.examcloud.core.basic.dao.entity.StudentEntity;
|
|
@@ -50,7 +52,8 @@ public class AuthController extends ControllerSupport {
|
|
|
|
|
|
@ApiOperation(value = "登入", notes = "")
|
|
@ApiOperation(value = "登入", notes = "")
|
|
@PostMapping("login")
|
|
@PostMapping("login")
|
|
- public User login(@RequestBody LoginInfo loginInfo, HttpServletRequest request) {
|
|
|
|
|
|
+ public Object login(@RequestBody LoginInfo loginInfo, HttpServletRequest request) {
|
|
|
|
+ setAlwaysOKResponse();
|
|
trim(loginInfo, false);
|
|
trim(loginInfo, false);
|
|
|
|
|
|
String realIp = request.getHeader("x-forwarded-for");
|
|
String realIp = request.getHeader("x-forwarded-for");
|
|
@@ -62,8 +65,15 @@ public class AuthController extends ControllerSupport {
|
|
} else {
|
|
} else {
|
|
loginInfo.setClientIp(null);
|
|
loginInfo.setClientIp(null);
|
|
}
|
|
}
|
|
|
|
+ Boolean alwaysOK = loginInfo.getAlwaysOK();
|
|
|
|
+
|
|
User user = authService.login(loginInfo);
|
|
User user = authService.login(loginInfo);
|
|
- return user;
|
|
|
|
|
|
+
|
|
|
|
+ if (null != alwaysOK && alwaysOK) {
|
|
|
|
+ return new StatusResponseEntity(ResponseStatus.SUCCESS, user);
|
|
|
|
+ } else {
|
|
|
|
+ return user;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "登出", notes = "")
|
|
@ApiOperation(value = "登出", notes = "")
|