he2802 4 жил өмнө
parent
commit
c5c9b19131

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

@@ -5,10 +5,13 @@ import com.zhongzheng.common.core.controller.BaseController;
 import com.zhongzheng.common.core.domain.AjaxResult;
 import com.zhongzheng.common.core.page.TableDataInfo;
 import com.zhongzheng.common.enums.BusinessType;
+import com.zhongzheng.common.utils.ServletUtils;
 import com.zhongzheng.common.utils.poi.ExcelUtil;
+import com.zhongzheng.framework.web.service.WxTokenService;
 import com.zhongzheng.modules.user.bo.UserAddBo;
 import com.zhongzheng.modules.user.bo.UserEditBo;
 import com.zhongzheng.modules.user.bo.UserQueryBo;
+import com.zhongzheng.modules.user.entity.ClientLoginUser;
 import com.zhongzheng.modules.user.service.IUserService;
 import com.zhongzheng.modules.user.vo.UserVo;
 import io.swagger.annotations.Api;
@@ -35,6 +38,8 @@ public class UserController extends BaseController {
 
     private final IUserService iUserService;
 
+    private final WxTokenService wxTokenService;
+
     /**
      * 修改客户端用户
      */
@@ -42,7 +47,12 @@ public class UserController extends BaseController {
     @Log(title = "客户端用户", businessType = BusinessType.UPDATE)
     @PostMapping("/edit")
     public AjaxResult<Void> edit(@RequestBody UserEditBo bo) {
+        ClientLoginUser loginUser = wxTokenService.getLoginUser(ServletUtils.getRequest());
+        if(loginUser.getUser().getUserId()!=bo.getUserId()){
+            return AjaxResult.error("无权限修改");
+        }
         return toAjax(iUserService.updateByEditBo(bo) ? 1 : 0);
+
     }
 
 

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

@@ -107,4 +107,8 @@ private static final long serialVersionUID=1L;
     private String lastLoginIp;
 
     private Long lastLoginTime;
+
+    private Integer certified;
+
+    private Long certifiedTime;
 }

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

@@ -108,5 +108,8 @@ public class UserVo {
 	@Excel(name = "状态 1正常 0关闭")
 	@ApiModelProperty("状态 1正常 0关闭")
 	private Integer status;
-
+	@ApiModelProperty("是否人脸认证成功  1成功 0没有")
+	private Integer certified;
+	@ApiModelProperty("人脸认证时间")
+	private Long certifiedTime;
 }

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

@@ -33,6 +33,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="registerPlat" column="register_plat"/>
         <result property="lastLoginIp" column="last_login_ip"/>
         <result property="lastLoginTime" column="last_login_time"/>
+        <result property="certified" column="certified"/>
+        <result property="certifiedTime" column="certified_time"/>
     </resultMap>