|
|
@@ -1,7 +1,13 @@
|
|
|
package com.uas.platform.b2c.common.account.v2.controller;
|
|
|
|
|
|
+import com.alibaba.fastjson.JSON;
|
|
|
import com.uas.account.entity.User;
|
|
|
import com.uas.platform.b2c.common.account.v2.service.UserService;
|
|
|
+import com.uas.sso.SSOHelper;
|
|
|
+import com.uas.sso.SSOToken;
|
|
|
+import javax.servlet.http.HttpServletRequest;
|
|
|
+import javax.servlet.http.HttpServletResponse;
|
|
|
+import org.apache.http.HttpRequest;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
import org.springframework.web.bind.annotation.PathVariable;
|
|
|
@@ -39,4 +45,11 @@ public class UserController {
|
|
|
public void removeUser(@PathVariable Long uu) {
|
|
|
userService.delete(uu);
|
|
|
}
|
|
|
+
|
|
|
+ @RequestMapping(value = "/login", method = RequestMethod.POST)
|
|
|
+ public void login(HttpServletRequest request,HttpServletResponse response,User user,String lastLoginTime){
|
|
|
+ SSOToken st = new SSOToken(request, user.getUid());
|
|
|
+ st.setData(JSON.toJSONString(user));
|
|
|
+ SSOHelper.setSSOCookie(request, response, st, true);
|
|
|
+ }
|
|
|
}
|