Pārlūkot izejas kodu

add 小程序登录绑定

he2802 3 gadi atpakaļ
vecāks
revīzija
b19f534c3a

+ 16 - 0
zhongzheng-api/src/main/java/com/zhongzheng/controller/user/UserController.java

@@ -13,6 +13,7 @@ import com.zhongzheng.modules.user.bo.UserEditBo;
 import com.zhongzheng.modules.user.entity.ClientLoginUser;
 import com.zhongzheng.modules.user.service.IUserService;
 import com.zhongzheng.modules.user.vo.RanKingUser;
+import com.zhongzheng.modules.user.vo.UserVo;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.RequiredArgsConstructor;
@@ -91,4 +92,19 @@ public class UserController extends BaseController {
         return toAjax(iUserService.bindIdCard(bo) ? 1 : 0);
     }
 
+    /**
+     * 获取用户信息
+     *
+     * @return 用户信息
+     */
+    @ApiOperation("登录用户信息")
+    @GetMapping("getInfo")
+    public AjaxResult<UserVo> getInfo()
+    {
+        ClientLoginUser loginUser = wxTokenService.getLoginUser(ServletUtils.getRequest());
+        UserVo vo = iUserService.queryById(loginUser.getUser().getUserId());
+        vo.setNull();
+        return AjaxResult.success(vo);
+    }
+
 }

+ 1 - 14
zhongzheng-api/src/main/java/com/zhongzheng/controller/wx/WxLoginController.java

@@ -90,19 +90,6 @@ public class WxLoginController
         return AjaxResult.success(map);
     }
 
-    /**
-     * 获取用户信息
-     *
-     * @return 用户信息
-     */
-    @ApiOperation("登录用户信息")
-    @GetMapping("getInfo")
-    public AjaxResult<UserVo> getInfo()
-    {
-        ClientLoginUser loginUser = wxTokenService.getLoginUser(ServletUtils.getRequest());
-        UserVo vo = iUserService.queryById(loginUser.getUser().getUserId());
-        vo.setNull();
-        return AjaxResult.success(vo);
-    }
+
 
 }

+ 2 - 2
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/vo/UserVo.java

@@ -238,9 +238,9 @@ public class UserVo {
 		this.setIdCardImg2(null);
 		this.setCertifiedTime(null);
 		this.setGzhOpenId(null);
-		if(this.getTelphone()!=null){
+	/*	if(this.getTelphone()!=null){
 			this.setTelphone(TelPhoneUtils.hideTelPhone(this.getTelphone()));
-		}
+		}*/
 		/*if(this.getIdCard()!=null){
 			this.setIdCard(TelPhoneUtils.hideTelPhone(this.getIdCard()));
 		}*/

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

@@ -135,13 +135,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     <select id="selectList" resultMap="UserResult">
         SELECT
-        u.*,
-        IFNULL( temp.num, 0 ) course_num,
-        IFNULL( temp1.study_time, 0 ) study_time
+        u.*
         FROM
         `user` u
-        LEFT JOIN ( SELECT opu.user_id, COUNT(*) num FROM order_possess_user opu WHERE opu.type_id = 1 GROUP BY opu.user_id ) temp ON u.user_id = temp.user_id
-        LEFT JOIN ( SELECT usr.user_id, sum( usr.study_duration ) study_time FROM user_study_record usr GROUP BY usr.user_id ) temp1 ON u.user_id = temp1.user_id
         WHERE
         1 = 1
         <if test="status != null and status.size()!=0 ">