|
@@ -33,13 +33,11 @@ public class PermissionFacade extends PermissionServiceImpl {
|
|
public RespDTO getPermission(String appkey, String secret) {
|
|
public RespDTO getPermission(String appkey, String secret) {
|
|
User user = userFacade.findByName(appkey);
|
|
User user = userFacade.findByName(appkey);
|
|
if (null == user) {
|
|
if (null == user) {
|
|
- throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
|
|
|
|
- "未找到对应的appkey【" + appkey + "】");
|
|
|
|
|
|
+ throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "未找到对应的appkey【" + appkey + "】");
|
|
}
|
|
}
|
|
PasswordEncoder passwordEncoder = PasswordEncoderFactories.createDelegatingPasswordEncoder();
|
|
PasswordEncoder passwordEncoder = PasswordEncoderFactories.createDelegatingPasswordEncoder();
|
|
if (!passwordEncoder.matches(secret, user.getPassword())) {
|
|
if (!passwordEncoder.matches(secret, user.getPassword())) {
|
|
- throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
|
|
|
|
- "appkey 或 secret 错误【" + appkey + "," + secret + "】");
|
|
|
|
|
|
+ throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "appkey 或 secret 错误【" + appkey + "," + secret + "】");
|
|
}
|
|
}
|
|
List<Permission> permissions = this.getPermissionByUserId(user.getId());
|
|
List<Permission> permissions = this.getPermissionByUserId(user.getId());
|
|
return RespDTO.onSuc(permissions);
|
|
return RespDTO.onSuc(permissions);
|