fix: 用æ店员头像bug
This commit is contained in:
@@ -3,6 +3,7 @@ package com.starry.admin.modules.weichat.service;
|
|||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import cn.hutool.http.HttpRequest;
|
import cn.hutool.http.HttpRequest;
|
||||||
import com.alibaba.fastjson2.JSONObject;
|
import com.alibaba.fastjson2.JSONObject;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import com.starry.admin.common.exception.ServiceException;
|
import com.starry.admin.common.exception.ServiceException;
|
||||||
import com.starry.admin.common.oss.service.IOssFileService;
|
import com.starry.admin.common.oss.service.IOssFileService;
|
||||||
import com.starry.admin.modules.clerk.module.entity.PlayClerkUserInfoEntity;
|
import com.starry.admin.modules.clerk.module.entity.PlayClerkUserInfoEntity;
|
||||||
@@ -14,9 +15,11 @@ import com.starry.admin.modules.custom.service.IPlayCustomUserInfoService;
|
|||||||
import com.starry.admin.utils.SecurityUtils;
|
import com.starry.admin.utils.SecurityUtils;
|
||||||
import com.starry.common.utils.ConvertUtil;
|
import com.starry.common.utils.ConvertUtil;
|
||||||
import com.starry.common.utils.IdUtils;
|
import com.starry.common.utils.IdUtils;
|
||||||
|
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import me.chanjar.weixin.common.bean.WxOAuth2UserInfo;
|
import me.chanjar.weixin.common.bean.WxOAuth2UserInfo;
|
||||||
import me.chanjar.weixin.common.bean.oauth2.WxOAuth2AccessToken;
|
import me.chanjar.weixin.common.bean.oauth2.WxOAuth2AccessToken;
|
||||||
@@ -68,12 +71,16 @@ public class WxOauthService {
|
|||||||
if (item == null) {
|
if (item == null) {
|
||||||
PlayClerkUserInfoEntity entity = ConvertUtil.entityToVo(userInfo, PlayClerkUserInfoEntity.class);
|
PlayClerkUserInfoEntity entity = ConvertUtil.entityToVo(userInfo, PlayClerkUserInfoEntity.class);
|
||||||
entity.setAvatar(generateAvatar(userInfo.getHeadImgUrl()));
|
entity.setAvatar(generateAvatar(userInfo.getHeadImgUrl()));
|
||||||
entity.setWeiChatAvatar(generateAvatar(userInfo.getHeadImgUrl()));
|
entity.setWeiChatAvatar(entity.getAvatar());
|
||||||
entity.setId(IdUtils.getUuid());
|
entity.setId(IdUtils.getUuid());
|
||||||
entity.setLevelId(playClerkLevelInfoService.getDefaultLevel().getId());
|
entity.setLevelId(playClerkLevelInfoService.getDefaultLevel().getId());
|
||||||
clerkUserInfoService.create(entity);
|
clerkUserInfoService.create(entity);
|
||||||
return entity.getId();
|
return entity.getId();
|
||||||
} else {
|
} else {
|
||||||
|
if (StrUtil.isEmpty(item.getAvatar())) {
|
||||||
|
clerkUserInfoService.update(Wrappers.lambdaUpdate(PlayClerkUserInfoEntity.class).eq(PlayClerkUserInfoEntity::getId, item.getId())
|
||||||
|
.set(PlayClerkUserInfoEntity::getAvatar, generateAvatar(userInfo.getHeadImgUrl())));
|
||||||
|
}
|
||||||
return item.getId();
|
return item.getId();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user