|
|
@@ -101,7 +101,7 @@ public class BladeUserDetailsServiceImpl implements UserDetailsService {
|
|
|
if (ObjectUtils.isNull(tenant) || ObjectUtils.isNull(tenant.getData())) {
|
|
|
throw new UsernameNotFoundException("未查到租户信息");
|
|
|
}
|
|
|
- user = userClient.loginByAccount(null, username, "4", tenant.getData().getTenantId(),appletsId);
|
|
|
+ user = userClient.loginByAccount(null, username, "4", tenant.getData().getTenantId(), appletsId);
|
|
|
if (ObjectUtils.isNull(user)) {
|
|
|
if ("wx0a0feca24b695636".equals(appletsId)) {
|
|
|
throw new UsernameNotFoundException(TokenUtil.USER_NOT_FOUND);
|
|
|
@@ -116,7 +116,6 @@ public class BladeUserDetailsServiceImpl implements UserDetailsService {
|
|
|
saveUser.setAppletsId(appletsId);
|
|
|
saveUser.setUnionId(unionId);
|
|
|
saveUser.setTenantId(tenant.getData().getTenantId());
|
|
|
- saveUser.setUserType(1);
|
|
|
saveUser.setAccount(username);
|
|
|
saveUser.setName(username);
|
|
|
saveUser.setRealName(username);
|
|
|
@@ -139,9 +138,9 @@ public class BladeUserDetailsServiceImpl implements UserDetailsService {
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
- user = userClient.loginByAccount(username, null, "2", null,null);
|
|
|
+ user = userClient.loginByAccount(username, null, "2", null, null);
|
|
|
if (ObjectUtils.isNull(user)) {
|
|
|
- user = userClient.loginByAccount(null, username, "2", null,null);
|
|
|
+ user = userClient.loginByAccount(null, username, "2", null, null);
|
|
|
if (ObjectUtils.isNull(user)) {
|
|
|
throw new UsernameNotFoundException(TokenUtil.USER_NOT_FOUND);
|
|
|
}
|
|
|
@@ -181,17 +180,19 @@ public class BladeUserDetailsServiceImpl implements UserDetailsService {
|
|
|
}
|
|
|
|
|
|
// 获取用户类型
|
|
|
- String userType = Func.toStr(request.getHeader(TokenUtil.USER_TYPE_HEADER_KEY), TokenUtil.DEFAULT_USER_TYPE);
|
|
|
+ Integer userType = user.getUserType();
|
|
|
|
|
|
// 远程调用返回数据
|
|
|
R<UserInfo> result;
|
|
|
// 根据不同用户类型调用对应的接口返回数据,用户可自行拓展
|
|
|
- if (userType.equals(UserEnum.WEB.getName())) {
|
|
|
+ if (userType == UserEnum.WEB.getCategory()) {
|
|
|
result = userClient.userInfo(tenantId, user.getAccount(), UserEnum.WEB.getName());
|
|
|
- } else if (userType.equals(UserEnum.APP.getName())) {
|
|
|
+ } else if (userType == UserEnum.APP.getCategory()) {
|
|
|
result = userClient.userInfo(tenantId, user.getAccount(), UserEnum.APP.getName());
|
|
|
- } else {
|
|
|
+ } else if (userType == UserEnum.OTHER.getCategory()) {
|
|
|
result = userClient.userInfo(tenantId, user.getAccount(), UserEnum.OTHER.getName());
|
|
|
+ } else {
|
|
|
+ result = userClient.userInfo(tenantId, user.getAccount(), UserEnum.WECHAT.getName());
|
|
|
}
|
|
|
|
|
|
// 判断返回信息
|
|
|
@@ -233,7 +234,7 @@ public class BladeUserDetailsServiceImpl implements UserDetailsService {
|
|
|
String corpName = "";
|
|
|
String corpAddress = "";
|
|
|
if (ObjectUtils.isNotNull(user.getId())) {
|
|
|
- R<Map<String, String>> r = paymentClient.getCorpDesc(user.getId(),user.getTenantId());
|
|
|
+ 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"));
|
|
|
@@ -325,7 +326,7 @@ public class BladeUserDetailsServiceImpl implements UserDetailsService {
|
|
|
String corpName = "";
|
|
|
String corpAddress = "";
|
|
|
if (ObjectUtils.isNotNull(user.getId())) {
|
|
|
- R<Map<String, String>> r = paymentClient.getCorpDesc(user.getId(),user.getTenantId());
|
|
|
+ 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"));
|