rentaiming
2024-06-21 b2ab426275d80c0c1a4972906f1b37b051aec2b1
ruoyi-modules/ruoyi-member/src/main/java/com/ruoyi/member/service/impl/MemberServiceImpl.java
@@ -89,9 +89,9 @@
    //微信
    private static final String ACCESS_TOKEN_HOST = "https://api.weixin.qq.com/cgi-bin/token";
    private static final String WX_APPID = "wxe91f1af7638aa5dd";
    private static final String WX_APPID = "wx69e3ac6e13a889b7";
    private static final String WX_SECRET = "a787e1a462715604e0c9528b6d8960d1";
    private static final String WX_SECRET = "1b8bcfcb681524ac553e72054e5271ef";
    //支付寶
    /**
@@ -186,6 +186,7 @@
                        sysUser = new SysUser();
                        sysUser.setUserName(memberId);
                        sysUser.setNickName("白金用户");
                        sysUser.setUserType("03");
                        sysUser.setPhonenumber(response.getOpenId());
                        sysUser.setAvatar("https://hongruitang.oss-cn-beijing.aliyuncs.com/default.png");
                        String password = "123456";
@@ -243,6 +244,7 @@
                        sysUser = new SysUser();
                        sysUser.setUserName(memberId);
                        sysUser.setNickName("白金用户");
                        sysUser.setUserType("03");
                        sysUser.setAvatar("https://hongruitang.oss-cn-beijing.aliyuncs.com/default.png");
                        String password = "123456";
                        sysUser.setPassword(SecurityUtils.encryptPassword(password));
@@ -390,8 +392,9 @@
    }
    @Override
    public void mobile(MobileDTO mobileDTO) {
    public String mobile(MobileDTO mobileDTO) {
        Member byId = this.getById(mobileDTO.getMemberid());
        String mobile=null;
        if (mobileDTO.getType()==1) {
            if (mobileDTO.getAuth_code() == null || mobileDTO.getAuth_code().length() == 0) {
            } else {
@@ -429,7 +432,7 @@
                String plainData = null;
                if (isDataEncrypted) {
                    try {
                        plainData = AlipayEncrypt.decryptContent(content, encryptType, "VSpPcLQjLSoTz6Yd7KNoyQ==", charset);
                        plainData = AlipayEncrypt.decryptContent(content, encryptType, "XABBSOeWDakvuG9TDez4Qg====", charset);
                    } catch (AlipayApiException e) {
                        //解密异常, 记录日志
                        e.getMessage();
@@ -442,8 +445,7 @@
                        new TypeReference<Map<String, String>>() {
                        }, Feature.OrderedField);
                byId.setPhone(openapiResult1.get("mobile"));
                this.updateById(byId);
                mobile=openapiResult1.get("mobile");
            }
        }else{
            String responseAccessToken = null;
@@ -469,10 +471,10 @@
            JSONObject jsonUserPhoneNumber = JSONObject.parseObject(responseUserPhoneNumber);
            String phoneInfo = jsonUserPhoneNumber.getString("phone_info");
            JSONObject jsonUserPhoneInfo = JSONObject.parseObject(phoneInfo);
            String mobile = jsonUserPhoneInfo.getString("purePhoneNumber");
            byId.setPhone(mobile);
            this.updateById(byId);
            mobile= jsonUserPhoneInfo.getString("purePhoneNumber");
        }
        return mobile;
    }
    public static String getAccessTokenByWX() throws Exception {