提交 54f2ad13 编写于 作者: sq3536's avatar sq3536

repair

上级 d05574b9
...@@ -3,6 +3,8 @@ package cn.ibizlab.api.rest.extensions; ...@@ -3,6 +3,8 @@ package cn.ibizlab.api.rest.extensions;
import cn.ibizlab.core.uaa.service.ISYS_PERMISSIONService; import cn.ibizlab.core.uaa.service.ISYS_PERMISSIONService;
import cn.ibizlab.util.client.IBZOUFeignClient; import cn.ibizlab.util.client.IBZOUFeignClient;
import cn.ibizlab.util.security.AuthTokenUtil;
import cn.ibizlab.util.security.AuthenticationInfo;
import cn.ibizlab.util.security.AuthenticationUser; import cn.ibizlab.util.security.AuthenticationUser;
import cn.ibizlab.util.security.AuthorizationLogin; import cn.ibizlab.util.security.AuthorizationLogin;
import cn.ibizlab.util.service.AuthenticationUserService; import cn.ibizlab.util.service.AuthenticationUserService;
...@@ -34,6 +36,10 @@ public class ClientAuthenticationResource ...@@ -34,6 +36,10 @@ public class ClientAuthenticationResource
@Value("${ibiz.jwt.header:Authorization}") @Value("${ibiz.jwt.header:Authorization}")
private String tokenHeader; private String tokenHeader;
@Autowired
private AuthTokenUtil jwtTokenUtil;
/** /**
* 实体操作标识 * 实体操作标识
*/ */
...@@ -54,8 +60,17 @@ public class ClientAuthenticationResource ...@@ -54,8 +60,17 @@ public class ClientAuthenticationResource
private ISYS_PERMISSIONService permissionService; private ISYS_PERMISSIONService permissionService;
@PostMapping(value = "v7/login") @PostMapping(value = "v7/login")
public ResponseEntity<AuthenticationUser> login(@Validated @RequestBody AuthorizationLogin authorizationLogin){ public ResponseEntity<AuthenticationInfo> login(@Validated @RequestBody AuthorizationLogin authorizationLogin){
return uaalogin(authorizationLogin); userDetailsService.resetByUsername(authorizationLogin.getUsername());
AuthenticationUser user = userDetailsService.loadUserByLogin(authorizationLogin.getUsername(),authorizationLogin.getPassword());
if(user.getPermissionList()==null)
{
setUserPermission(user);
setUserOrgInfo(user);
}
final String token = jwtTokenUtil.generateToken(user);
// 返回 token
return ResponseEntity.ok().body(new AuthenticationInfo(token,user));
} }
@PostMapping(value = "uaa/login") @PostMapping(value = "uaa/login")
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册