提交 da8fbb01 编写于 作者: nancy's avatar nancy

resource reset

上级 bbe8ac88
......@@ -71,7 +71,7 @@ public class UserDingtalkRegisterResource {
* @return
*/
@PostMapping(value = "/uaa/queryDingtalkUserByCode")
public ResponseEntity<AuthenticationInfo> queryDingtalkUserByCode(@RequestParam(value = "id",required = false) String id,@RequestParam(value = "code",required = false) String tmpcode,@RequestBody JSONObject param) {
public ResponseEntity<JSONObject> queryDingtalkUserByCode(@RequestParam(value = "id",required = false) String id,@RequestParam(value = "code",required = false) String tmpcode,@RequestBody JSONObject param) {
JSONObject object = new JSONObject();
// 空校验
String code = param.getString("code");
......@@ -80,19 +80,7 @@ public class UserDingtalkRegisterResource {
if (StringUtils.isEmpty(code))
throw new BadRequestAlertException("code为空", "UserDingtalkRegisterResource", "");
AuthenticationUser ibzuser = userDingtalkRegisterService.getUserByToken(id,code);
// 生成登录token信息
String tokenUsername = ibzuser.getLoginname()+(StringUtils.isEmpty(ibzuser.getDomain())?"":("|"+ibzuser.getDomain()));
userDetailsService.resetByUsername(tokenUsername);
AuthenticationUser user = userDetailsService.loadUserByUsername(tokenUsername);
final String token = jwtTokenUtil.generateToken(user);
AuthenticationUser user2 = new AuthenticationUser();
CachedBeanCopier.copy(user, user2);
user2.setAuthorities(null);
user2.setPermissionList(null);
return ResponseEntity.ok().body(new AuthenticationInfo(token,user2));
return ResponseEntity.ok().body(getUserBySnsCode(id,code));
}
@GetMapping(value = "/uaa/open/dingtalk/sns/{code}")
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册