|
@@ -2,10 +2,14 @@ package com.uas.platform.b2c.common.account.controller;
|
|
|
|
|
|
|
|
import com.uas.platform.b2c.common.account.model.User;
|
|
import com.uas.platform.b2c.common.account.model.User;
|
|
|
import com.uas.platform.b2c.common.account.model.UserInfo;
|
|
import com.uas.platform.b2c.common.account.model.UserInfo;
|
|
|
|
|
+import com.uas.platform.b2c.common.account.service.UserService;
|
|
|
import com.uas.platform.b2c.core.support.SystemSession;
|
|
import com.uas.platform.b2c.core.support.SystemSession;
|
|
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.http.HttpStatus;
|
|
import org.springframework.http.HttpStatus;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
|
|
+import javax.servlet.http.HttpServletRequest;
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
*
|
|
*
|
|
|
*/
|
|
*/
|
|
@@ -13,6 +17,9 @@ import org.springframework.web.bind.annotation.*;
|
|
|
@RequestMapping("/user/authentication")
|
|
@RequestMapping("/user/authentication")
|
|
|
public class AuthenticationController {
|
|
public class AuthenticationController {
|
|
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private UserService userService;
|
|
|
|
|
+
|
|
|
@RequestMapping(method = RequestMethod.GET, headers = "Accept=application/json")
|
|
@RequestMapping(method = RequestMethod.GET, headers = "Accept=application/json")
|
|
|
@ResponseBody
|
|
@ResponseBody
|
|
|
@ResponseStatus(value = HttpStatus.OK)
|
|
@ResponseStatus(value = HttpStatus.OK)
|
|
@@ -23,6 +30,22 @@ public class AuthenticationController {
|
|
|
return new UserInfo(SystemSession.getUser());
|
|
return new UserInfo(SystemSession.getUser());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 个人注册企业成功后刷新企业列表信息
|
|
|
|
|
+ * @return userInfo
|
|
|
|
|
+ */
|
|
|
|
|
+ @RequestMapping(value = "/reflash", method = RequestMethod.GET, headers = "Accept=application/json")
|
|
|
|
|
+ @ResponseBody
|
|
|
|
|
+ @ResponseStatus(value = HttpStatus.OK)
|
|
|
|
|
+ public UserInfo getAuthenticationAfterRegister(HttpServletRequest request) {
|
|
|
|
|
+ if (SystemSession.getUser() == null) {
|
|
|
|
|
+ return null;
|
|
|
|
|
+ }
|
|
|
|
|
+ User user = userService.findUserByUserUU(SystemSession.getUser().getUserUU());
|
|
|
|
|
+ request.getSession().setAttribute("user",user);
|
|
|
|
|
+ return new UserInfo(user);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 切换企业
|
|
* 切换企业
|
|
|
*
|
|
*
|