|
@@ -7,13 +7,16 @@
|
|
|
|
|
|
package cn.com.qmth.examcloud.app.controller.version_1_0;
|
|
package cn.com.qmth.examcloud.app.controller.version_1_0;
|
|
|
|
|
|
|
|
+import cn.com.qmth.examcloud.app.core.utils.StrUtils;
|
|
import cn.com.qmth.examcloud.app.model.LoginType;
|
|
import cn.com.qmth.examcloud.app.model.LoginType;
|
|
import cn.com.qmth.examcloud.app.model.Result;
|
|
import cn.com.qmth.examcloud.app.model.Result;
|
|
import cn.com.qmth.examcloud.app.model.UserInfo;
|
|
import cn.com.qmth.examcloud.app.model.UserInfo;
|
|
|
|
+import cn.com.qmth.examcloud.app.model.UserToken;
|
|
import cn.com.qmth.examcloud.app.service.RedisService;
|
|
import cn.com.qmth.examcloud.app.service.RedisService;
|
|
import cn.com.qmth.examcloud.app.service.UserAuthService;
|
|
import cn.com.qmth.examcloud.app.service.UserAuthService;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.LoggerFactory;
|
|
import org.slf4j.LoggerFactory;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -21,6 +24,8 @@ import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
|
|
|
|
+import static cn.com.qmth.examcloud.app.model.Constants.APP_SESSION_EXPIRE_TIME;
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 认证中心相关接口
|
|
* 认证中心相关接口
|
|
*
|
|
*
|
|
@@ -42,7 +47,7 @@ public class UserAuthRestController {
|
|
@RequestMapping(value = "/user/login", method = {RequestMethod.GET, RequestMethod.POST})
|
|
@RequestMapping(value = "/user/login", method = {RequestMethod.GET, RequestMethod.POST})
|
|
public Result<UserInfo> login(@RequestParam String account, @RequestParam String password, @RequestParam(required = false) String accountType,
|
|
public Result<UserInfo> login(@RequestParam String account, @RequestParam String password, @RequestParam(required = false) String accountType,
|
|
@RequestParam(required = false) Long rootOrgId, @RequestParam(required = false) String domain) throws Exception {
|
|
@RequestParam(required = false) Long rootOrgId, @RequestParam(required = false) String domain) throws Exception {
|
|
- if (accountType == null) {
|
|
|
|
|
|
+ if (StringUtils.isBlank(accountType)) {
|
|
accountType = LoginType.COMMON_LOGIN_NAME.name();
|
|
accountType = LoginType.COMMON_LOGIN_NAME.name();
|
|
}
|
|
}
|
|
Result<UserInfo> result = userAuthService.login(account, password, accountType, rootOrgId, domain);
|
|
Result<UserInfo> result = userAuthService.login(account, password, accountType, rootOrgId, domain);
|