|
|
@@ -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);
|
|
|
+
|
|
|
}
|
|
|
|
|
|
|