|
@@ -1,9 +1,11 @@
|
|
|
package cn.com.qmth.examcloud.service.core.api;
|
|
|
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestParam;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
import cn.com.qmth.examcloud.commons.base.exception.StatusException;
|
|
@@ -43,4 +45,19 @@ public class AuthController extends ControllerSupport {
|
|
|
}
|
|
|
authService.logout(user);
|
|
|
}
|
|
|
+
|
|
|
+ @ApiOperation(value = "获取登录用户", notes = "")
|
|
|
+ @PostMapping("getLoginUser")
|
|
|
+ public User getLoginUser(@RequestParam String key, @RequestParam String token) {
|
|
|
+
|
|
|
+ if (StringUtils.isBlank(key)) {
|
|
|
+ throw new StatusException("P-001009", "key is blank");
|
|
|
+ }
|
|
|
+ if (StringUtils.isBlank(key)) {
|
|
|
+ throw new StatusException("P-001010", "token is blank");
|
|
|
+ }
|
|
|
+
|
|
|
+ return authService.getLoginUser(key, token);
|
|
|
+ }
|
|
|
+
|
|
|
}
|