优化微信用户优化名

This commit is contained in:
sj
2022-11-15 13:50:03 +08:00
parent 010132f237
commit c424bc0ca8
3 changed files with 5 additions and 2 deletions
@@ -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();
@@ -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();
@@ -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()