admin
2021-01-25 2ba431be9c12a79783e0f9ef249292b7fa95f2a1
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserAccountServiceImpl.java
@@ -20,6 +20,7 @@
import org.yeshi.utils.JsonUtil;
import org.yeshi.utils.entity.FileUploadResult;
import org.yeshi.utils.entity.ProxyIP;
import org.yeshi.utils.entity.wx.WeiXinUser;
import org.yeshi.utils.tencentcloud.COSManager;
import com.google.gson.Gson;
@@ -36,7 +37,6 @@
import com.yeshi.fanli.entity.bus.user.UserExtraTaoBaoInfo;
import com.yeshi.fanli.entity.bus.user.UserInfo;
import com.yeshi.fanli.entity.bus.user.UserInfoModifyRecord.ModifyTypeEnum;
import com.yeshi.fanli.entity.bus.user.WeiXinUser;
import com.yeshi.fanli.exception.user.ForbiddenUserIdentifyCodeException;
import com.yeshi.fanli.exception.user.UserAccountException;
import com.yeshi.fanli.log.LogHelper;
@@ -53,11 +53,11 @@
import com.yeshi.fanli.service.inter.user.msg.UserAccountMsgNotificationService;
import com.yeshi.fanli.service.inter.user.tb.UserExtraTaoBaoInfoService;
import com.yeshi.fanli.util.factory.msg.MsgAccountDetailFactory;
import com.yeshi.fanli.util.wx.WXLoginUtil;
import com.yeshi.fanli.util.wx.MyWXLoginUtil;
import net.sf.json.JSONObject;
import org.yeshi.utils.wx.WXAppLoginUtil;
import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisPool;
import redis.clients.jedis.Transaction;
@Service
@@ -171,7 +171,7 @@
                case 2:// 微信
                    // 通过Code换取信息
                    WXAccountInfoDTO wxAccount = Constant.getWXAccount(acceptData.getPlatform(), acceptData.getVersion());
                    weiXinUser = WXLoginUtil.getWeiXinUserWithSavePortrait(code, wxAccount.getAppId(),
                    weiXinUser = MyWXLoginUtil.getWeiXinUserWithSavePortrait(code, wxAccount.getAppId(),
                            wxAccount.getAppSecret());
                    if (weiXinUser == null)
                        throw new UserAccountException(1001, "无法获取到微信个人信息");
@@ -388,7 +388,7 @@
            case 2:// 微信
                // 通过Code换取信息
                WXAccountInfoDTO wxAccount = Constant.getWXAccount(acceptData.getPlatform(), acceptData.getVersion());
                weiXinUser = WXLoginUtil.getWeiXinUserWithSavePortrait(code, wxAccount.getAppId(),
                weiXinUser = MyWXLoginUtil.getWeiXinUserWithSavePortrait(code, wxAccount.getAppId(),
                        wxAccount.getAppSecret());
                if (weiXinUser == null)
                    throw new UserAccountException(1001, "无法获取到微信个人信息");
@@ -711,7 +711,7 @@
        if (user == null)
            throw new UserAccountException(4, "用户不存在");
        WXAccountInfoDTO wxAccount = Constant.getWXAccount(acceptData.getPlatform(), acceptData.getVersion());
        WeiXinUser weiXinUser = WXLoginUtil.getWeiXinUserWithSavePortrait(code, wxAccount.getAppId(),
        WeiXinUser weiXinUser = MyWXLoginUtil.getWeiXinUserWithSavePortrait(code, wxAccount.getAppId(),
                wxAccount.getAppSecret());
        if (weiXinUser == null)
            throw new UserAccountException(10, "获取微信用户信息失败");
@@ -1038,7 +1038,7 @@
        LogHelper.lgoinInfo(logInfo.toString());
        // 通过Code换取信息
        WeiXinUser weiXinUser = WXLoginUtil.getWeiXinUser(code, businessSystem.getWxAppId(), businessSystem.getWxAppSecret());
        WeiXinUser weiXinUser = WXAppLoginUtil.getWeiXinUser(code, businessSystem.getWxAppId(), businessSystem.getWxAppSecret());
        if (weiXinUser == null) {
            throw new UserAccountException(1, "微信帐号授权失败");
        }
@@ -1142,7 +1142,7 @@
        LogHelper.lgoinInfo(logInfo.toString());
        // 通过Code换取信息
        WeiXinUser weiXinUser = WXLoginUtil.getWeiXinUser(wxCode, businessSystem.getWxAppId(), businessSystem.getWxAppSecret());
        WeiXinUser weiXinUser = WXAppLoginUtil.getWeiXinUser(wxCode, businessSystem.getWxAppId(), businessSystem.getWxAppSecret());
        if (weiXinUser == null) {
            throw new UserAccountException(1, "微信帐号授权失败");
        }
@@ -1235,7 +1235,7 @@
    @Override
    public void bindWeiXin(AcceptData acceptData, Long uid, String code) throws UserAccountException {
        WXAccountInfoDTO wxAccount = Constant.getWXAccount(acceptData.getPlatform(), acceptData.getVersion());
        WeiXinUser weiXinUser = WXLoginUtil.getWeiXinUser(code, wxAccount.getAppId(), wxAccount.getAppSecret());
        WeiXinUser weiXinUser = WXAppLoginUtil.getWeiXinUser(code, wxAccount.getAppId(), wxAccount.getAppSecret());
        if (weiXinUser == null) {
            throw new UserAccountException(2, "微信帐号授权失败");
        }
@@ -1451,7 +1451,7 @@
        // 通过Code换取信息
        WXAccountInfoDTO wxAccount = Constant.getWXAccount(acceptData.getPlatform(), acceptData.getVersion());
        WeiXinUser weiXinUser = WXLoginUtil.getWeiXinUser(code, wxAccount.getAppId(), wxAccount.getAppSecret());
        WeiXinUser weiXinUser = WXAppLoginUtil.getWeiXinUser(code, wxAccount.getAppId(), wxAccount.getAppSecret());
        if (weiXinUser == null) {
            throw new UserAccountException(1, "微信帐号授权失败");
        }