Commit 6c4b33b7 by 朱瑞泽

代码调整

parent eb8eebeb
......@@ -53,8 +53,30 @@ public class AuthcenterTestController {
* @return 用户详情
*/
@RequestMapping("/authcenter-code-callback")
public String authcenterCodeCallback(@RequestParam(name = "code") String code) {
return JSON.toJSONString(gicAuthcenterManager.processCode(code));
public String authcenterCodeCallback(@RequestParam(name = "code") String code, HttpServletResponse response) {
// 也可以直接调用 gicAuthcenterManager.processCode(code) 获取用户信息,session user 需要自己维护
return JSON.toJSONString(gicAuthcenterManager.login(code, response));
}
/**
* 获取用户详情
*
* @return 用户详情
*/
@RequestMapping("/get-login-user")
public String getLoginUser() {
return JSON.toJSONString(gicAuthcenterManager.getLoginUser());
}
/**
* 获取用户详情
*
* @return 用户详情
*/
@RequestMapping("/logout")
public String logout() {
gicAuthcenterManager.logout();
return "ok";
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment