he2802 před 4 roky
rodič
revize
87dc7cff55

+ 2 - 2
zhongzheng-admin/src/main/resources/application.yml

@@ -242,5 +242,5 @@ feign:
     enabled: true
 wx:
   small:
-    appid: 123
-    appsecret: 3434
+    appid: wx8295c6fa6b0b3106
+    appsecret: 2a95e366da4c4b17a3963e9756b878fd

+ 2 - 2
zhongzheng-api/src/main/resources/application.yml

@@ -239,5 +239,5 @@ feign:
 
 wx:
   small:
-    appid: 123
-    appsecret: 3434
+    appid: wx8295c6fa6b0b3106
+    appsecret: 2a95e366da4c4b17a3963e9756b878fd

+ 7 - 5
zhongzheng-framework/src/main/java/com/zhongzheng/framework/web/service/WxLoginService.java

@@ -65,7 +65,7 @@ public class WxLoginService
      * @param tel
      * @return
      */
-    public String register_small(String openId,String unionId,String tel) {
+    public Boolean register_small(String openId,String unionId,String tel) {
         UserAddBo bo = new UserAddBo();
         bo.setOpenId(openId);
         bo.setUnionId(unionId);
@@ -75,13 +75,16 @@ public class WxLoginService
         //雪花算法产生账号ID
         SnowflakeIdUtils idWorker = new SnowflakeIdUtils(3, 1);
         bo.setUserAccout(String.valueOf(idWorker.nextId()));
-        return null;
+        bo.setSex(1);
+        bo.setStatus(1);
+        bo.setRegisterPlat("1");
+        return iUserService.insertByAddBo(bo);
     }
 
     public String getWxUnionId(String code) {
         String url = String.format(wxAuthUrl, appid, appsrcret, code);
-        WxLoginResultBo wxLoginResult = restTemplate.getForObject(url, WxLoginResultBo.class);
-        return null;
+    //    WxLoginResultBo wxLoginResult = restTemplate.getForObject(url, WxLoginResultBo.class);
+        return "cba";
     }
 
     public void obtainWxPhone(String iv, String encryptedData,String session_key){
@@ -93,7 +96,6 @@ public class WxLoginService
                     Base64.decodeBase64(iv));
 
             userInfo = new String(resultByte, "UTF-8");
-
             userInfoJSON = JSON.parseObject(userInfo);
         } catch (Exception e) {
             e.printStackTrace();

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/bo/UserAddBo.java

@@ -89,4 +89,6 @@ public class UserAddBo {
     private Integer status;
     @ApiModelProperty("$column.columnComment")
     private String unionId;
+    @ApiModelProperty("注册平台 1小程序")
+    private String registerPlat;
 }

+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/domain/User.java

@@ -100,4 +100,7 @@ private static final long serialVersionUID=1L;
     private Integer status;
 
     private String unionId;
+
+    /** 注册平台 1小程序 */
+    private String registerPlat;
 }

+ 1 - 0
zhongzheng-system/src/main/resources/mapper/modules/user/UserMapper.xml

@@ -30,6 +30,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="updateTime" column="update_time"/>
         <result property="status" column="status"/>
         <result property="unionId" column="union_id"/>
+        <result property="registerPlat" column="register_plat"/>
     </resultMap>