Browse Source

优化微信用户优化名

zyj
sj 2 years ago
parent
commit
c424bc0ca8
  1. 4
      zsw-bxg/src/main/java/co/yixiang/app/modules/services/AppAuthService.java
  2. 1
      zsw-bxg/src/main/java/co/yixiang/app/modules/wechat/rest/controller/WxMaUserController.java
  3. 2
      zsw-bxg/src/main/java/co/yixiang/modules/product/rest/StoreProductController.java

4
zsw-bxg/src/main/java/co/yixiang/app/modules/services/AppAuthService.java

@ -166,11 +166,13 @@ public class AppAuthService {
//过滤掉表情
String ip = co.yixiang.app.common.util.IpUtil.getRequestIp();
yxUser = YxUser.builder()
.username(phoneNoInfo.getPhoneNumber())
.username(StringUtils.isNotBlank(phoneNoInfo.getPhoneNumber())?phoneNoInfo.getPhoneNumber():session.getOpenid())
// .username(phoneNoInfo.getPhoneNumber())
.phone(phoneNoInfo.getPhoneNumber())
.addIp(ip)
.openId(session.getOpenid())
.lastIp(ip)
.nickname(StringUtils.isNotBlank(phoneNoInfo.getPhoneNumber())?phoneNoInfo.getPhoneNumber():session.getOpenid())
.userType(AppFromEnum.ROUNTINE.getValue())
.build();

1
zsw-bxg/src/main/java/co/yixiang/app/modules/wechat/rest/controller/WxMaUserController.java

@ -103,6 +103,7 @@ public class WxMaUserController {
phone = phoneNoInfo.getPhoneNumber();
user.setPhone(phone);
user.setUsername(phone);//默认没绑手机号的用户username是openId,绑定手机号时候也修改为手机号
userService.updateById(user);
} catch (Exception e) {
e.printStackTrace();

2
zsw-bxg/src/main/java/co/yixiang/modules/product/rest/StoreProductController.java

@ -126,7 +126,7 @@ public class StoreProductController {
String newHtml = "";
Map<String,Object> map = new HashMap<>();
newHtml = String.join("", Collections.nCopies(1,html));
//为了前端级联选择器好显示,这里分类名也字段名为storeName
//为了前端级联选择器好显示,这里分类名也字段名为storeName
map.put("id",yxStoreCategory.getId());
map.put("storeName",newHtml + yxStoreCategory.getCateName());
List<YxStoreProduct> list=yxStoreProductService.lambdaQuery()

Loading…
Cancel
Save