admin
2019-09-12 155913b57ad50126240bc3d5c1aef6ebfe12e3cf
微信开放平台修改
5个文件已删除
14个文件已修改
1个文件已添加
1612 ■■■■ 已修改文件
fanli/src/main/java/com/yeshi/fanli/controller/AuthCallBackController.java 46 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/ConfigController.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/InviteGetMoneyController.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/UserAccountController.java 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/UserInfoController.java 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/ConfigControllerV2.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/InviteControllerV2.java 28 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/ShareControllerV2.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/xcx/XcxGoodsClassController.java 305 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/xcx/XcxMiniControllerUtil.java 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/xcx/XcxSearchController.java 442 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/xcx/XcxSystemMiniController.java 98 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/xcx/XcxUserInfoController.java 440 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dto/wx/WXAccountInfoDTO.java 53 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserAccountServiceImpl.java 52 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserInfoExtraServiceImpl.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/user/UserAccountService.java 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/user/UserInfoExtraService.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/Constant.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/wx/WXLoginUtil.java 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/AuthCallBackController.java
@@ -13,6 +13,7 @@
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import com.yeshi.fanli.entity.bus.user.UserActiveLog;
import com.yeshi.fanli.entity.bus.user.UserInfo;
import com.yeshi.fanli.entity.bus.user.UserInfoModifyRecord.ModifyTypeEnum;
import com.yeshi.fanli.entity.taobao.TaoBaoUnionAuthRecord;
@@ -21,6 +22,7 @@
import com.yeshi.fanli.log.LogHelper;
import com.yeshi.fanli.service.inter.msg.UserAccountMsgNotificationService;
import com.yeshi.fanli.service.inter.taobao.TaoBaoUnionAuthRecordService;
import com.yeshi.fanli.service.inter.user.UserActiveLogService;
import com.yeshi.fanli.service.inter.user.UserExtraTaoBaoInfoService;
import com.yeshi.fanli.service.inter.user.UserInfoModifyRecordService;
import com.yeshi.fanli.util.AESUtil;
@@ -29,6 +31,7 @@
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.util.TaoBaoConstant;
import com.yeshi.fanli.util.ThreadUtil;
import com.yeshi.fanli.util.VersionUtil;
import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
import net.sf.json.JSONObject;
@@ -57,6 +60,9 @@
    @Resource
    private RedisManager redisManager;
    @Resource
    private UserActiveLogService userActiveLogService;
    @RequestMapping(value = "tb")
    public void tb(String code, String state, HttpServletRequest request, HttpServletResponse response) {
@@ -283,35 +289,67 @@
            LogHelper.errorDetailInfo(e);
        }
        UserActiveLog activeLog = userActiveLogService.getUserLatestActiveInfo(uid);
        boolean isNewJump = false;
        if (activeLog != null) {
            String platform = null;
            String version = activeLog.getVersionCode();
            if (activeLog.getChannel().equalsIgnoreCase("appstore")) {
                platform = "ios";
            } else {
                platform = "android";
            }
            if (VersionUtil.greaterThan_2_0(platform, version)) {
                isNewJump = true;
            }
        }
        try {
            if (errCode == 0)// 成功
            {
                if ("share".equalsIgnoreCase(source)) {
                    // response.sendRedirect("http://apph5.yeshitv.com/apppage/flq_bonusState.html?code=0");
                    if (isNewJump)
                        response.sendRedirect("http://apph5.yeshitv.com/flqWeb/h5/tbauth/success.html");
                    else
                    closeWebPage(response.getWriter());
                } else if ("zigou".equalsIgnoreCase(source)) {
                    // response.sendRedirect("http://apph5.yeshitv.com/apppage/flq_rebateState.html?code=0");
                    if (isNewJump)
                        response.sendRedirect("http://apph5.yeshitv.com/flqWeb/h5/tbauth/success.html");
                    else
                    closeWebPage(response.getWriter());
                } else if ("bind".equalsIgnoreCase(source)) {
                    if (isNewJump)
                        response.sendRedirect("http://apph5.yeshitv.com/flqWeb/h5/tbauth/success.html");
                    else {
                    String script = String.format(
                            "<script>if(/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)) {window.location.href = 'yestv://toast#%s';setTimeout(function(){window.location.href = 'yestv://finishPage';},100);} else {yestv.toast(\"恭喜你,淘宝绑定成功\");yestv.finishPage();}</script>",
                            StringUtil.getBase64String("恭喜你,淘宝绑定成功"));
                    response.getWriter().print(script);
                }
                }
            } else {// 失败
                if ("share".equalsIgnoreCase(source)) {
                    // response.sendRedirect("http://apph5.yeshitv.com/apppage/flq_bonusState.html?code=1");
                    if (isNewJump)
                        response.sendRedirect("http://apph5.yeshitv.com/flqWeb/h5/tbauth/fail.html");
                    else
                    closeWebPage(response.getWriter());
                } else if ("zigou".equalsIgnoreCase(source)) {
                    // response.sendRedirect("http://apph5.yeshitv.com/apppage/flq_rebateState.html?code=1");
                    if (isNewJump)
                        response.sendRedirect("http://apph5.yeshitv.com/flqWeb/h5/tbauth/fail.html");
                    else
                    closeWebPage(response.getWriter());
                } else if ("bind".equalsIgnoreCase(source)) {
                    if (isNewJump)
                        response.sendRedirect("http://apph5.yeshitv.com/flqWeb/h5/tbauth/fail.html");
                    else {
                    String script = String.format(
                            "<script>if(/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)) {window.location.href = 'yestv://toast#%s';setTimeout(function(){window.location.href = 'yestv://finishPage';},100);} else {yestv.toast(\"抱歉,淘宝绑定失败\");yestv.finishPage();}</script>",
                            StringUtil.getBase64String("抱歉,淘宝绑定失败"));
                    response.getWriter().print(script);
                }
            }
            }
        } catch (Exception e) {
        }
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/ConfigController.java
@@ -282,7 +282,8 @@
            data.put("serviceProtocolLink", serviceProtocol);
            data.put("privacyProtocolLink", privacyProtocol);
            // 购物车跳转方式(包含jumpDetail与params)
            JSONObject source = JSONObject.fromObject(configService.get("taobao_cart_jump_detail"));
            JSONObject source = JSONObject.fromObject(configService.getByVersion("taobao_cart_jump_detail",
                    acceptData.getPlatform(), Integer.parseInt(acceptData.getVersion())));
            data.put("taoBaoCart", source);
            out.print(JsonUtil.loadTrueResult(data));
        } catch (Exception e) {
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/InviteGetMoneyController.java
@@ -137,7 +137,6 @@
            data.put("topBanner", pictureJson);
        }
        data.put("desc", configService.get("invite_desc"));
        boolean hasCode = false;
@@ -270,7 +269,6 @@
        }
    }
    /**
     * 激活邀请
     * 
@@ -285,7 +283,8 @@
    @RequestMapping(value = "activationInviteWX")
    public void activationInviteWX(AcceptData acceptData, Long uid, String  code, PrintWriter out) {
        try {
            userInfoExtraService.activationInviteWX(uid, code);
            userInfoExtraService.activationInviteWX(
                    Constant.getWXAccount(acceptData.getPlatform(), acceptData.getVersion()), uid, code);
            out.print(JsonUtil.loadTrueResult("邀请码激活成功"));
        } catch (UserInfoExtraException e) {
            out.print(JsonUtil.loadFalseResult(e.getMsg()));
@@ -294,7 +293,6 @@
            e.printStackTrace();
        }
    }
    
    /**
     * 获取邀请码
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/UserAccountController.java
@@ -14,6 +14,7 @@
import org.yeshi.utils.encrypt.DESUtil;
import com.alipay.api.AlipayApiException;
import com.yeshi.fanli.dto.wx.WXAccountInfoDTO;
import com.yeshi.fanli.entity.accept.AcceptData;
import com.yeshi.fanli.entity.bus.user.BindingAccount;
import com.yeshi.fanli.entity.bus.user.ForbiddenUserIdentifyCode;
@@ -221,8 +222,8 @@
        tbUserInfo.setTbPic(tbPortrait);
        try {
            LoginResult result = userAccountService.login(request, first, system.getAppid(), code, phone, tbUserInfo,
                    wxinstall, loginType);
            LoginResult result = userAccountService.login(request, acceptData, first, system.getAppid(), code, phone,
                    tbUserInfo, wxinstall, loginType);
            if (result == null)
                LogHelper.error("login-result为空值");
@@ -387,7 +388,10 @@
        }
        UserInfo user = null;
        if (!StringUtil.isNullOrEmpty(code)) {
            WeiXinUser weiXinUser = WXLoginUtil.getWeiXinUserWithSavePortrait(code);
            WXAccountInfoDTO accountInfo = Constant.getWXAccount(acceptData.getPlatform(), acceptData.getVersion());
            WeiXinUser weiXinUser = WXLoginUtil.getWeiXinUserWithSavePortrait(code, accountInfo.getAppId(),
                    accountInfo.getAppSecret());
            if (weiXinUser == null) {
                out.print(JsonUtil.loadFalseResult(1, "获取微信用户信息失败"));
                return;
@@ -640,7 +644,7 @@
        }
        try {
            userAccountService.changeWXBind(uid, code);
            userAccountService.changeWXBind(acceptData, uid, code);
            UserInfo user = userInfoService.getUserByIdWithMybatis(uid);
            // 判断taoBaoUid是否已经封禁
            ForbiddenUserIdentifyCode ic = forbiddenUserIdentifyCodeService
@@ -941,6 +945,8 @@
        String[] ALIPAY_CODES = new String[] { "SYSTEM_ERROR", "PERMIT_CHECK_PERM_LIMITED", "PERM_AML_NOT_REALNAME_REV",
                "PERM_AML_NOT_REALNAME_REV", "PAYEE_USER_INFO_ERROR", "PAYEE_ACC_OCUPIED",
                "PERMIT_CHECK_PERM_IDENTITY_THEFT", "PERMIT_NON_BANK_LIMIT_PAYEE", "EXCEED_LIMIT_UNRN_DM_AMOUNT" };
        BindingAccount oldBindingAccount = bindingAccountService.getBindingAccountByUidAndType(uid,
                BindingAccount.TYPE_ALIPAY);
        try {
            BigDecimal balance = user.getMyHongBao();
            BindingAccount bindingAccount = bindingAccountService.changeAlipayBindingWithVerify(uid, name, account);
@@ -974,7 +980,11 @@
        } catch (AlipayAccountException e3) {
            // 账户无余额
            if (e3.getCode() == AlipayAccountException.CODE_NO_MONEY) {
                out.print(JsonUtil.loadFalseResult(5, "你的账户目前没有余额,无需绑定提现账号。"));
                if (oldBindingAccount != null) {
                    out.print(JsonUtil.loadFalseResult(5, "当前账户没有余额,无需修改,请有余额后修改"));
                } else {
                    out.print(JsonUtil.loadFalseResult(5, "当前账户没有余额,请有余额后绑定"));
                }
                return;
                // 提现次数限制
            } else if (e3.getCode() == AlipayAccountException.CODE_TIMES_LIMIT) {
@@ -1156,7 +1166,7 @@
            // 微信登录
            if (loginType == 2) {
                userInfo = userAccountService.loginWinXin(request, loginType, code, system.getAppid());
                userInfo = userAccountService.loginWinXin(request, acceptData, loginType, code, system.getAppid());
            }
            if (userInfo == null) {
@@ -1312,7 +1322,7 @@
        }
        try {
            userAccountService.bindWeiXin(uid, code);
            userAccountService.bindWeiXin(acceptData,uid, code);
            UserInfo user = userInfoService.getUserByIdWithMybatis(uid);
            // 判断taoBaoUid是否已经封禁
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/UserInfoController.java
@@ -40,6 +40,7 @@
import com.yeshi.fanli.dto.HongBaoDTO;
import com.yeshi.fanli.dto.money.AccountDetails;
import com.yeshi.fanli.dto.order.OrderItem;
import com.yeshi.fanli.dto.wx.WXAccountInfoDTO;
import com.yeshi.fanli.entity.AppVersionInfo;
import com.yeshi.fanli.entity.accept.AcceptData;
import com.yeshi.fanli.entity.bus.user.AccountMessage;
@@ -293,7 +294,9 @@
            int loginType = form.getLoginType();
            // WeiXinUserParam wxParam = null;
            // 如果是微信登陆,那需要先获取到微信的unionid
            WeiXinUser weiXinUser = WXLoginUtil.getWeiXinUserWithSavePortrait(code);
            WXAccountInfoDTO account = Constant.getWXAccount(acceptData.getPlatform(), acceptData.getVersion());
            WeiXinUser weiXinUser = WXLoginUtil.getWeiXinUserWithSavePortrait(code, account.getAppId(),
                    account.getAppSecret());
            if (loginType == Constant.WEIXIN && StringUtil.isNullOrEmpty(form.getWxUnionId())) {
                // wxParam = WXinUtil.getWxParam(code);
                if (weiXinUser == null) {
@@ -388,7 +391,11 @@
                                                 * StringUtil.isNullOrEmpty(form
                                                 * .getWxOpenId())
                                                 */) {
                WeiXinUser xinUser = WXLoginUtil.getWeiXinUserWithSavePortrait(code);
                WXAccountInfoDTO account = Constant.getWXAccount(acceptData.getPlatform(), acceptData.getVersion());
                WeiXinUser xinUser = WXLoginUtil.getWeiXinUserWithSavePortrait(code, account.getAppId(),
                        account.getAppSecret());
                if (xinUser == null) {
                    out.print(JsonUtil.loadFalseResult("登录失败"));
                    return;
@@ -647,7 +654,9 @@
        }
        int loginType = form.getLoginType();
        if (loginType == Constant.WEIXIN) {
            WeiXinUser weiXinUser = WXLoginUtil.getWeiXinUserWithSavePortrait(code);
            WXAccountInfoDTO account = Constant.getWXAccount(acceptData.getPlatform(), acceptData.getVersion());
            WeiXinUser weiXinUser = WXLoginUtil.getWeiXinUserWithSavePortrait(code, account.getAppId(),
                    account.getAppSecret());
            if (weiXinUser == null) {
                out.print(JsonUtil.loadFalseResult("绑定失败,用户异常请重试!"));
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/ConfigControllerV2.java
@@ -245,11 +245,17 @@
        JSONObject data = new JSONObject();
        if (url != null && url.contains("ifeeds.tmall.com/article.html?")) {
            if (VersionUtil.greaterThan_2_0(acceptData.getPlatform(), acceptData.getVersion()))
                data.put("baichuan", false);
            else
            data.put("baichuan", true);
            data.put("goodsDetail", false);
        } else if (url != null && (url.contains("s.click") || url.contains("taobao.com") || url.contains("tmall.com")
                || url.contains("m.tb.cn"))) {
            data.put("baichuan", true);// 采用阿里百川的方式加载webview
            if (VersionUtil.greaterThan_2_0(acceptData.getPlatform(), acceptData.getVersion()))
                data.put("baichuan", false);
            else
                data.put("baichuan", true);
            data.put("goodsDetail", true);// 需要拦截商品详情
        } else if (url != null && (url.contains("jd.com"))) {
            // 不能包含详情页
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/InviteControllerV2.java
@@ -34,7 +34,6 @@
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
@Controller
@RequestMapping("api/v2/invite")
public class InviteControllerV2 {
@@ -60,11 +59,9 @@
    @Resource
    private ThreeSaleExtraInfoSerivce threeSaleExtraInfoSerivce;
    /**
     * 邀请码验证
     *
     * @param out
     */
    @RequestMapping(value = "verifyCode")
@@ -81,15 +78,16 @@
        }
    }
    
    /**
     * 邀请码微信
     *
     * @param out
     */
    @RequestMapping(value = "verifyWX")
    public void verifyWX(AcceptData acceptData, Long uid, String code, PrintWriter out) {
        try {
            UserInfo userInfo = userInfoExtraService.getInviterInfo(uid, code);
            UserInfo userInfo = userInfoExtraService.getInviterInfo(
                    Constant.getWXAccount(acceptData.getPlatform(), acceptData.getVersion()), uid, code);
            JSONObject data = new JSONObject();
            data.put("nickName", userInfo.getNickName());
            data.put("portrait", userInfo.getPortrait());
@@ -141,10 +139,9 @@
        out.print(JsonUtil.loadTrueResult(resultData));
    }
    
    /**
     * 组织数据
     *
     * @param count
     * @param list
     * @param uid
@@ -232,7 +229,6 @@
        return result;
    }
    /**
     * 用户队员统计- IOS
     * 
@@ -296,6 +292,7 @@
    
    /**
     * 上级信息组织
     *
     * @param acceptData
     * @param uid
     * @param threeSale
@@ -336,10 +333,9 @@
        return bossData;
    } 
    
    /**
     * 站内信提醒队员添加微信号
     *
     * @param acceptData
     * @param uid
     * @param inviteId
@@ -386,12 +382,14 @@
            // 提示队长
            bossId = remindId;
            workerId = uid;
            content = "你的一级队员"+ userInfo.getNickName() +",提醒你添加微信号,以便于和你取得联系和学习省钱技巧,赶快去添加吧;注:请升级到本软件最新版本在“我的-我的信息”中添加。";
            content = "你的一级队员" + userInfo.getNickName()
                    + ",提醒你添加微信号,以便于和你取得联系和学习省钱技巧,赶快去添加吧;注:请升级到本软件最新版本在“我的-我的信息”中添加。";
        } else {
            // 提示队员
            bossId = uid;
            workerId = remindId;
            content = "你的邀请人"+ userInfo.getNickName() +",提醒你添加微信号,以便于和你取得联系帮助你更好的省钱,赶快去添加吧;注:请升级到本软件最新版本在“我的-我的信息”中添加。";
            content = "你的邀请人" + userInfo.getNickName()
                    + ",提醒你添加微信号,以便于和你取得联系帮助你更好的省钱,赶快去添加吧;注:请升级到本软件最新版本在“我的-我的信息”中添加。";
        }
        
        try {
@@ -399,8 +397,8 @@
            List<String> listAndroid = new ArrayList<String>();
            pushService.pushZNX(remindId, title, content, listIOS, listAndroid);
            
            userSystemMsgService.addUserSystemMsg(remindId, UserSystemMsgTypeEnum.common,
                    title, content, UserSystemMsg.TIME_TAG_COMMON, null);
            userSystemMsgService.addUserSystemMsg(remindId, UserSystemMsgTypeEnum.common, title, content,
                    UserSystemMsg.TIME_TAG_COMMON, null);
            
            ThreeSaleExtraInfo newInfo = new ThreeSaleExtraInfo();
            if (remindBoss) {
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/ShareControllerV2.java
@@ -370,8 +370,7 @@
        try {
            TaoBaoGoodsBrief goods = null;
            try {
                goods = TaoKeApiUtil.searchGoodsDetail(auctionId, new TaoKeAppInfo(TaoBaoConstant.TAOBAO_AUTH_APPKEY,
                        TaoBaoConstant.TAOBAO_AUTH_APPSECRET, TaoBaoConstant.TAOBAO_SPECIAL_PID_DEFAULT));
                goods = TaoKeApiUtil.searchGoodsDetail(auctionId);
            } catch (TaobaoGoodsDownException e2) {
                e2.printStackTrace();
            }
@@ -381,6 +380,11 @@
                return;
            }
            if (goods.getTkRate() == null || goods.getTkRate().compareTo(new BigDecimal(0)) <= 0) {
                //TaoKeApiUtil.specialConvertCoupon(auctionId, app);
            }
            // 计算推广红包
            String warningRate = configTaoLiJinService.getValueByKey("warning_value", new Date());
            LogHelper.error("推广红包比例:"+warningRate);
fanli/src/main/java/com/yeshi/fanli/controller/xcx/XcxGoodsClassController.java
File was deleted
fanli/src/main/java/com/yeshi/fanli/controller/xcx/XcxMiniControllerUtil.java
File was deleted
fanli/src/main/java/com/yeshi/fanli/controller/xcx/XcxSearchController.java
File was deleted
fanli/src/main/java/com/yeshi/fanli/controller/xcx/XcxSystemMiniController.java
File was deleted
fanli/src/main/java/com/yeshi/fanli/controller/xcx/XcxUserInfoController.java
File was deleted
fanli/src/main/java/com/yeshi/fanli/dto/wx/WXAccountInfoDTO.java
New file
@@ -0,0 +1,53 @@
package com.yeshi.fanli.dto.wx;
public class WXAccountInfoDTO {
    // 公众号
    private String gzAppId;
    private String gzAppSecret;
    // APP
    private String appId;
    private String appSecret;
    public WXAccountInfoDTO(String gzAppId, String gzAppSecret, String appId, String appSecret) {
        this.gzAppId = gzAppId;
        this.gzAppSecret = gzAppSecret;
        this.appId = appId;
        this.appSecret = appSecret;
    }
    public WXAccountInfoDTO() {
    }
    public String getGzAppId() {
        return gzAppId;
    }
    public void setGzAppId(String gzAppId) {
        this.gzAppId = gzAppId;
    }
    public String getGzAppSecret() {
        return gzAppSecret;
    }
    public void setGzAppSecret(String gzAppSecret) {
        this.gzAppSecret = gzAppSecret;
    }
    public String getAppId() {
        return appId;
    }
    public void setAppId(String appId) {
        this.appId = appId;
    }
    public String getAppSecret() {
        return appSecret;
    }
    public void setAppSecret(String appSecret) {
        this.appSecret = appSecret;
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserAccountServiceImpl.java
@@ -24,6 +24,8 @@
import com.yeshi.fanli.dao.mybatis.AccountMessageMapper;
import com.yeshi.fanli.dao.mybatis.UserConnectHistoryMapper;
import com.yeshi.fanli.dao.mybatis.UserInfoMapper;
import com.yeshi.fanli.dto.wx.WXAccountInfoDTO;
import com.yeshi.fanli.entity.accept.AcceptData;
import com.yeshi.fanli.entity.bus.user.BindingAccount;
import com.yeshi.fanli.entity.bus.user.ForbiddenUserIdentifyCode;
import com.yeshi.fanli.entity.bus.user.ForbiddenUserIdentifyCode.ForbiddenUserIdentifyCodeTypeEnum;
@@ -112,15 +114,15 @@
    @Resource
    private JedisPool jedisPool;
    
    @Lazy
    @Resource
    private UserInfoModifyRecordService userInfoModifyRecordService;
    
    @Transactional
    @Override
    public LoginResult login(HttpServletRequest request, Boolean first, String appId, String code, String phone,
            UserInfo tbUserInfo, boolean wxinstall, int loginType) throws UserAccountException {
    public LoginResult login(HttpServletRequest request, AcceptData acceptData, Boolean first, String appId,
            String code, String phone, UserInfo tbUserInfo, boolean wxinstall, int loginType)
            throws UserAccountException {
        JSONObject logInfo = new JSONObject();
        logInfo.put("appId", appId);
@@ -182,7 +184,9 @@
            case 2:// 微信
                    // 通过Code换取信息
                weiXinUser = WXLoginUtil.getWeiXinUserWithSavePortrait(code);
                WXAccountInfoDTO wxAccount = Constant.getWXAccount(acceptData.getPlatform(), acceptData.getVersion());
                weiXinUser = WXLoginUtil.getWeiXinUserWithSavePortrait(code, wxAccount.getAppId(),
                        wxAccount.getAppSecret());
                if (weiXinUser == null)
                    throw new UserAccountException(1001, "无法获取到微信个人信息");
                LogHelper.test("微信授权用户信息:" + new Gson().toJson(weiXinUser));
@@ -363,7 +367,7 @@
            }
        } else {// 没有安装微信
            LoginResult result = loginNoInstallWX(appId, code, phone, tbUserInfo, loginType);
            LoginResult result = loginNoInstallWX(acceptData, appId, code, phone, tbUserInfo, loginType);
            if (result.getType() == LoginResult.TYPE_CREATE)
                session.setAttribute("LAST_LOGIN_USER", result.getUser());
            return result;
@@ -372,8 +376,8 @@
    @Transactional
    @Override
    public LoginResult loginNoInstallWX(String appId, String code, String phone, UserInfo tbUserInfo, int loginType)
            throws UserAccountException {
    public LoginResult loginNoInstallWX(AcceptData acceptData, String appId, String code, String phone,
            UserInfo tbUserInfo, int loginType) throws UserAccountException {
        JSONObject logInfo = new JSONObject();
        logInfo.put("appId", appId);
        logInfo.put("code", code);
@@ -397,7 +401,9 @@
            break;
        case 2:// 微信
                // 通过Code换取信息
            weiXinUser = WXLoginUtil.getWeiXinUserWithSavePortrait(code);
            WXAccountInfoDTO wxAccount = Constant.getWXAccount(acceptData.getPlatform(), acceptData.getVersion());
            weiXinUser = WXLoginUtil.getWeiXinUserWithSavePortrait(code, wxAccount.getAppId(),
                    wxAccount.getAppSecret());
            if (weiXinUser == null)
                throw new UserAccountException(1001, "无法获取到微信个人信息");
@@ -713,7 +719,6 @@
            e.printStackTrace();
        }
        
        if (!StringUtil.isNullOrEmpty(user.getPhone())) 
            userInfoModifyRecordService.addModifyRecord(uid, ModifyTypeEnum.bindPhone, user.getPhone());
        
@@ -744,7 +749,6 @@
        update.setPhone(phone);
        userInfoMapper.updateByPrimaryKeySelective(update);
        userAccountMsgNotificationService.bindingSuccess(uid, MsgAccountDetailFactory.TYPE_PHONE);
        
        userInfoModifyRecordService.addModifyRecord(uid, ModifyTypeEnum.bindPhone, phone);
    }
@@ -830,11 +834,13 @@
    }
    @Override
    public void changeWXBind(Long uid, String code) throws UserAccountException {
    public void changeWXBind(AcceptData acceptData, Long uid, String code) throws UserAccountException {
        UserInfo user = userInfoMapper.selectByPrimaryKey(uid);
        if (user == null)
            throw new UserAccountException(4, "用户不存在");
        WeiXinUser weiXinUser = WXLoginUtil.getWeiXinUserWithSavePortrait(code);
        WXAccountInfoDTO wxAccount = Constant.getWXAccount(acceptData.getPlatform(), acceptData.getVersion());
        WeiXinUser weiXinUser = WXLoginUtil.getWeiXinUserWithSavePortrait(code, wxAccount.getAppId(),
                wxAccount.getAppSecret());
        if (weiXinUser == null)
            throw new UserAccountException(10, "获取微信用户信息失败");
        if (weiXinUser.getUnionid().equalsIgnoreCase(user.getWxUnionId()))
@@ -842,7 +848,7 @@
        UserInfo newUser = getUserInfoByWXUnionId(user.getAppId(), weiXinUser.getUnionid());
        if (newUser != null)
            throw new UserAccountException(13, "亲,你要更换绑定的微信号已被其他账号绑定");
            throw new UserAccountException(13, "该微信号已被其他账号绑定");
        UserInfo updateUserInfo = new UserInfo(uid);
        updateUserInfo.setWxName(weiXinUser.getNickname());
@@ -869,7 +875,6 @@
        userInfoMapper.updateByPrimaryKeySelective(updateUserInfo);
        userAccountMsgNotificationService.changeBindingSuccess(uid, MsgAccountDetailFactory.TYPE_WX);
        
        userInfoModifyRecordService.addModifyRecord(uid, ModifyTypeEnum.bindWeiXin, weiXinUser.getUnionid());
    }
@@ -1064,8 +1069,8 @@
    @Transactional
    @Override
    public UserInfo loginWinXin(HttpServletRequest request, int loginType, String code, String appId)
            throws UserAccountException {
    public UserInfo loginWinXin(HttpServletRequest request, AcceptData acceptData, int loginType, String code,
            String appId) throws UserAccountException {
        // 日志信息
        JSONObject logInfo = new JSONObject();
        logInfo.put("appId", appId);
@@ -1074,7 +1079,9 @@
        LogHelper.lgoinInfo(logInfo.toString());
        // 通过Code换取信息
        WeiXinUser weiXinUser = WXLoginUtil.getWeiXinUserWithSavePortrait(code);
        WXAccountInfoDTO wxAccount = Constant.getWXAccount(acceptData.getPlatform(), acceptData.getVersion());
        WeiXinUser weiXinUser = WXLoginUtil.getWeiXinUserWithSavePortrait(code, wxAccount.getAppId(),
                wxAccount.getAppSecret());
        if (weiXinUser == null) {
            throw new UserAccountException(1, "微信帐号授权失败");
        }
@@ -1133,7 +1140,8 @@
                        e.printStackTrace();
                    }
                    
                    userInfoModifyRecordService.addModifyRecord(userInfo.getId(), ModifyTypeEnum.bindWeiXin, weiXinUser.getUnionid());
                    userInfoModifyRecordService.addModifyRecord(userInfo.getId(), ModifyTypeEnum.bindWeiXin,
                            weiXinUser.getUnionid());
                }
                return userInfo;
            }
@@ -1205,13 +1213,14 @@
    }
    @Override
    public void bindWeiXin(Long uid, String code) throws UserAccountException {
    public void bindWeiXin(AcceptData acceptData, Long uid, String code) throws UserAccountException {
        UserInfo user = userInfoMapper.selectByPrimaryKey(uid);
        if (user == null) {
            throw new UserAccountException(1, "用户不存在");
        }
        WeiXinUser weiXinUser = WXLoginUtil.getWeiXinUserWithSavePortrait(code);
        WXAccountInfoDTO wxAccount = Constant.getWXAccount(acceptData.getPlatform(), acceptData.getVersion());
        WeiXinUser weiXinUser = WXLoginUtil.getWeiXinUserWithSavePortrait(code, wxAccount.getAppId(),
                wxAccount.getAppSecret());
        if (weiXinUser == null) {
            throw new UserAccountException(2, "微信帐号授权失败");
        }
@@ -1272,7 +1281,6 @@
        userAccountBindingHistoryService.addUserAccountBindingHistory(history);
        userAccountMsgNotificationService.bindingSuccess(uid, MsgAccountDetailFactory.TYPE_WX);
        
        userInfoModifyRecordService.addModifyRecord(uid, ModifyTypeEnum.bindWeiXin, wxUnionId);
    }
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserInfoExtraServiceImpl.java
@@ -16,6 +16,7 @@
import com.yeshi.fanli.dao.mybatis.user.UserInfoExtraMapper;
import com.yeshi.fanli.dao.mybatis.user.UserRankRecordMapper;
import com.yeshi.fanli.dto.wx.WXAccountInfoDTO;
import com.yeshi.fanli.entity.bus.user.ThreeSale;
import com.yeshi.fanli.entity.bus.user.UserInfo;
import com.yeshi.fanli.entity.bus.user.UserInfoExtra;
@@ -384,7 +385,7 @@
    
    
    @Override
    public void activationInviteWX(Long uid, String code) throws UserInfoExtraException{
    public void activationInviteWX(WXAccountInfoDTO wxAccount, Long uid, String code) throws UserInfoExtraException{
        if (uid == null || code == null) {
            throw new UserInfoExtraException(1, "激活信息不完整");
        }
@@ -405,7 +406,7 @@
        }
        
        // 获取微信信息
        WeiXinUser weiXinUser = WXLoginUtil.getWeiXinUserWithSavePortrait(code);
        WeiXinUser weiXinUser = WXLoginUtil.getWeiXinUserWithSavePortrait(code,wxAccount.getAppId(),wxAccount.getAppSecret());
        if (weiXinUser == null) {
            throw new UserInfoExtraException(1, "微信授权失败");
        }
@@ -608,7 +609,7 @@
    
    
    @Override
    public UserInfo getInviterInfo(Long uid, String code) throws UserInfoExtraException{
    public UserInfo getInviterInfo(WXAccountInfoDTO wxAccount,Long uid, String code) throws UserInfoExtraException{
        if (code == null) {
            throw new UserInfoExtraException(1, "code信息不完整");
        }
@@ -629,7 +630,7 @@
        }
        
        // 获取微信信息
        WeiXinUser weiXinUser = WXLoginUtil.getWeiXinUser(code);
        WeiXinUser weiXinUser = WXLoginUtil.getWeiXinUser(code,wxAccount.getAppId(),wxAccount.getAppSecret());
        if (weiXinUser == null) {
            throw new UserInfoExtraException(1, "微信授权失败");
        }
fanli/src/main/java/com/yeshi/fanli/service/inter/user/UserAccountService.java
@@ -3,6 +3,7 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import com.yeshi.fanli.entity.accept.AcceptData;
import com.yeshi.fanli.entity.bus.user.LoginResult;
import com.yeshi.fanli.entity.bus.user.UserInfo;
import com.yeshi.fanli.exception.user.UserAccountException;
@@ -25,7 +26,7 @@
     * @return
     * @throws UserAccountException
     */
    public LoginResult login(HttpServletRequest request, Boolean first, String appId, String code, String phone,
    public LoginResult login(HttpServletRequest request,AcceptData acceptData,  Boolean first, String appId, String code, String phone,
            UserInfo tbUserInfo, boolean wxinstall, int loginType) throws UserAccountException;
    /**
@@ -39,7 +40,7 @@
     * @return
     * @throws UserAccountException
     */
    public LoginResult loginNoInstallWX(String appId, String code, String phone, UserInfo tbUserInfo, int loginType)
    public LoginResult loginNoInstallWX(AcceptData acceptData, String appId, String code, String phone, UserInfo tbUserInfo, int loginType)
            throws UserAccountException;
    /**
@@ -152,7 +153,7 @@
     * @param uid
     * @param code
     */
    public void changeWXBind(Long uid, String code) throws UserAccountException;
    public void changeWXBind(AcceptData acceptData,Long uid, String code) throws UserAccountException;
    /**
     * 清理用户头像
@@ -190,7 +191,7 @@
     * @return
     * @throws UserAccountException
     */
    public UserInfo loginWinXin(HttpServletRequest request,int loginType, String code, String appId)
    public UserInfo loginWinXin(HttpServletRequest request,AcceptData acceptData,int loginType, String code, String appId)
            throws UserAccountException;
    /**
@@ -207,7 +208,7 @@
     * @param code
     * @throws UserAccountException
     */
    public void bindWeiXin(Long uid, String code) throws UserAccountException;
    public void bindWeiXin(AcceptData acceptData,Long uid, String code) throws UserAccountException;
    /**
     * 账户封禁
fanli/src/main/java/com/yeshi/fanli/service/inter/user/UserInfoExtraService.java
@@ -1,5 +1,6 @@
package com.yeshi.fanli.service.inter.user;
import com.yeshi.fanli.dto.wx.WXAccountInfoDTO;
import com.yeshi.fanli.entity.bus.user.UserInfo;
import com.yeshi.fanli.entity.bus.user.UserInfoExtra;
import com.yeshi.fanli.entity.bus.user.UserRank;
@@ -81,7 +82,7 @@
     * @param code
     * @throws UserInfoExtraException
     */
    public void activationInviteWX(Long uid, String code) throws UserInfoExtraException;
    public void activationInviteWX(WXAccountInfoDTO wxAccount,Long uid, String code) throws UserInfoExtraException;
    /**
     * 判断是否是新用户
@@ -119,6 +120,6 @@
     * @return
     * @throws UserInfoExtraException
     */
    public UserInfo getInviterInfo(Long uid, String code) throws UserInfoExtraException;
    public UserInfo getInviterInfo(WXAccountInfoDTO wxAccount,Long uid, String code) throws UserInfoExtraException;
    
}
fanli/src/main/java/com/yeshi/fanli/util/Constant.java
@@ -7,7 +7,7 @@
import org.yeshi.utils.annotation.MapUtil;
import com.yeshi.fanli.entity.accept.AcceptData;
import com.yeshi.fanli.dto.wx.WXAccountInfoDTO;
import com.yeshi.fanli.entity.config.AlipayConfig;
import com.yeshi.fanli.entity.config.ConstantConfig;
import com.yeshi.fanli.entity.config.SMSConfig;
@@ -268,4 +268,14 @@
        else
            return "返利券";
    }
    public static WXAccountInfoDTO getWXAccount(String platform, String version) {
//        if (VersionUtil.greaterThan_2_0(platform, version)) {
//            return new WXAccountInfoDTO("wxa99686bb65a9f466", "57390718ddedaa1591f6876cdcf96f43", "wx879fb78463222cd5",
//                    "2ad8ec333a9f96b13c5c5c1c2b13cd67");
//        } else {
            return new WXAccountInfoDTO("wx43617e2ed82c5b28", "f8a65908fb4681bdd181de70f6ab9a3b", "wx5c0d167c6e3ad726",
                    "0c79d5869bb0f2d7c13e43f9a18f440d");
//        }
    }
}
fanli/src/main/java/com/yeshi/fanli/util/wx/WXLoginUtil.java
@@ -19,14 +19,9 @@
    public static String WEXIN_APPID = "wx43617e2ed82c5b28";
    public static String WEXIN_SECRET = "f8a65908fb4681bdd181de70f6ab9a3b";
    static String APPID = "wx5c0d167c6e3ad726";
    static String SECRET = "0c79d5869bb0f2d7c13e43f9a18f440d";
    static {
        WEXIN_APPID = Constant.systemCommonConfig.getWxGZAppId();
        WEXIN_SECRET = Constant.systemCommonConfig.getWxGZAppSecret();
        APPID = Constant.systemCommonConfig.getWxOpenAppId();
        SECRET = Constant.systemCommonConfig.getWxOpenAppSecret();
    }
    // 通过code获取access_token openId
@@ -34,8 +29,8 @@
    public static String weiXinUrl2 = "https://api.weixin.qq.com/sns/userinfo?access_token=%s&openid=%s&lang=zh_CN";
    public static WeiXinUserParam getWxParam(String code) {
        String wxUrl = String.format(weiXinUrl1, APPID, SECRET, code);
    public static WeiXinUserParam getWxParam(String code,String appId,String appSecret) {
        String wxUrl = String.format(weiXinUrl1, appId, appSecret, code);
        String result = HttpUtil.get(wxUrl);
        WeiXinUserParam weiXinUserParam = getWeiXinUserParam(result);
        return weiXinUserParam;
@@ -76,8 +71,8 @@
        return weiXinUser;
    }
    public static WeiXinUser getWeiXinUser(String code) {
        WeiXinUserParam param = getWxParam(code);
    public static WeiXinUser getWeiXinUser(String code,String appId,String appSecret) {
        WeiXinUserParam param = getWxParam(code,appId,appSecret);
        if (param == null) {
            return null;
        }
@@ -95,8 +90,8 @@
     * @param code
     * @return
     */
    public static WeiXinUser getWeiXinUserWithSavePortrait(String code) {
        WeiXinUser user = getWeiXinUser(code);
    public static WeiXinUser getWeiXinUserWithSavePortrait(String code,String appId,String appSecret) {
        WeiXinUser user = getWeiXinUser(code,appId,appSecret);
        if (user != null) {
            if (!StringUtil.isNullOrEmpty(user.getHeadimgurl())) {