|
@@ -11,8 +11,6 @@ import org.springblade.common.cache.CacheNames;
|
|
|
import org.springblade.core.redis.cache.BladeRedis;
|
|
|
import org.springblade.core.tool.api.R;
|
|
|
import org.springblade.core.tool.utils.*;
|
|
|
-import org.springblade.pay.tonglianPayment.entity.Parameters;
|
|
|
-import org.springblade.pay.tonglianPayment.fegin.IPaymentClient;
|
|
|
import org.springblade.system.entity.Tenant;
|
|
|
import org.springblade.system.feign.ISysClient;
|
|
|
import org.springblade.system.user.entity.User;
|
|
@@ -49,7 +47,7 @@ public class BladeUserDetailsServiceImpl implements UserDetailsService {
|
|
|
private final BladeRedis bladeRedis;
|
|
|
private final IWxUnionIdOpenIdClient wxUnionIdOpenIdClient;
|
|
|
|
|
|
- private final IPaymentClient paymentClient;
|
|
|
+// private final IPaymentClient paymentClient;
|
|
|
|
|
|
@Override
|
|
|
@SneakyThrows
|
|
@@ -78,7 +76,7 @@ public class BladeUserDetailsServiceImpl implements UserDetailsService {
|
|
|
//判断是否是小程序登录
|
|
|
if (ObjectUtils.isNotNull(appletsId)) {
|
|
|
//通过小程序appId查到租户信息
|
|
|
- R<Parameters> parametersR = paymentClient.getByAppId(appletsId);
|
|
|
+/* R<Parameters> parametersR = paymentClient.getByAppId(appletsId);
|
|
|
if (!parametersR.isSuccess()) {
|
|
|
throw new UsernameNotFoundException("未查到租户信息");
|
|
|
}
|
|
@@ -91,10 +89,10 @@ public class BladeUserDetailsServiceImpl implements UserDetailsService {
|
|
|
if ("wx0a0feca24b695636".equals(appletsId)) {
|
|
|
throw new UsernameNotFoundException(TokenUtil.USER_NOT_FOUND);
|
|
|
}
|
|
|
- /*User user1 = userClient.loginByAccount(null, username, null, tenant.getData().getTenantId());
|
|
|
+ *//*User user1 = userClient.loginByAccount(null, username, null, tenant.getData().getTenantId());
|
|
|
if (ObjectUtils.isNotNull(user1.getUserType()) && 4 != user1.getUserType()) {
|
|
|
throw new UsernameNotFoundException(TokenUtil.USER_NOT_FORBIDDEN);
|
|
|
- }*/
|
|
|
+ }*//*
|
|
|
//用户不存在,注册用户
|
|
|
User saveUser = new User();
|
|
|
saveUser.setOpenId(openId);
|
|
@@ -120,7 +118,7 @@ public class BladeUserDetailsServiceImpl implements UserDetailsService {
|
|
|
throw new UsernameNotFoundException(result.getMsg());
|
|
|
}
|
|
|
user = saveUser;
|
|
|
- }
|
|
|
+ }*/
|
|
|
|
|
|
} else {
|
|
|
user = userClient.loginByAccount(username, null, "2", null, null);
|
|
@@ -222,7 +220,7 @@ public class BladeUserDetailsServiceImpl implements UserDetailsService {
|
|
|
Long corpId = null;
|
|
|
String corpName = "";
|
|
|
String corpAddress = "";
|
|
|
- if (ObjectUtils.isNotNull(user.getId())) {
|
|
|
+/* if (ObjectUtils.isNotNull(user.getId())) {
|
|
|
R<Map<String, String>> r = paymentClient.getCorpDesc(user.getId(), user.getTenantId());
|
|
|
if (r.isSuccess()) {
|
|
|
if (ObjectUtils.isNotNull(r.getData().get("corpId"))) {
|
|
@@ -231,7 +229,7 @@ public class BladeUserDetailsServiceImpl implements UserDetailsService {
|
|
|
corpName = r.getData().get("corpName");
|
|
|
corpAddress = r.getData().get("corpAddress");
|
|
|
}
|
|
|
- }
|
|
|
+ }*/
|
|
|
return new BladeUserDetails(user1.getId(),
|
|
|
user1.getTenantId(), StringPool.EMPTY, user1.getName(), user1.getRealName(), user1.getDeptId(), user1.getPostId(), user1.getRoleId(), Func.join(userInfo.getRoles()), Func.toStr(user1.getAvatar(), TokenUtil.DEFAULT_AVATAR),
|
|
|
user1.getAccount(), AuthConstant.ENCRYPT + user1.getPassword(), userInfo.getDetail(), true, true, true, true,
|
|
@@ -314,16 +312,16 @@ public class BladeUserDetailsServiceImpl implements UserDetailsService {
|
|
|
Long corpId = null;
|
|
|
String corpName = "";
|
|
|
String corpAddress = "";
|
|
|
- if (ObjectUtils.isNotNull(user.getId())) {
|
|
|
- R<Map<String, String>> r = paymentClient.getCorpDesc(user.getId(), user.getTenantId());
|
|
|
- if (r.isSuccess()) {
|
|
|
- if (ObjectUtils.isNotNull(r.getData().get("corpId"))) {
|
|
|
- corpId = Long.parseLong(r.getData().get("corpId"));
|
|
|
- }
|
|
|
- corpName = r.getData().get("corpName");
|
|
|
- corpAddress = r.getData().get("corpAddress");
|
|
|
- }
|
|
|
- }
|
|
|
+// if (ObjectUtils.isNotNull(user.getId())) {
|
|
|
+// R<Map<String, String>> r = paymentClient.getCorpDesc(user.getId(), user.getTenantId());
|
|
|
+// if (r.isSuccess()) {
|
|
|
+// if (ObjectUtils.isNotNull(r.getData().get("corpId"))) {
|
|
|
+// corpId = Long.parseLong(r.getData().get("corpId"));
|
|
|
+// }
|
|
|
+// corpName = r.getData().get("corpName");
|
|
|
+// corpAddress = r.getData().get("corpAddress");
|
|
|
+// }
|
|
|
+// }
|
|
|
return new BladeUserDetails(user.getId(),
|
|
|
user.getTenantId(), StringPool.EMPTY, user.getName(), user.getRealName(), user.getDeptId(), user.getPostId(), user.getRoleId(), Func.join(userInfo.getRoles()), Func.toStr(user.getAvatar(), TokenUtil.DEFAULT_AVATAR),
|
|
|
username, AuthConstant.ENCRYPT + user.getPassword(), userInfo.getDetail(), true, true, true, true,
|