From 29fcb54693e8730251382d1446872bc0d7e8a964 Mon Sep 17 00:00:00 2001 From: lidongdong <1459917685@qq.com> Date: 星期二, 18 十月 2022 09:39:37 +0800 Subject: [PATCH] 修改新增普通用户报错 bug --- flower_city/src/main/java/com/dg/core/controller/UserController.java | 15 ++++++++++++--- 1 files changed, 12 insertions(+), 3 deletions(-) diff --git a/flower_city/src/main/java/com/dg/core/controller/UserController.java b/flower_city/src/main/java/com/dg/core/controller/UserController.java index 7815ece..29d6511 100644 --- a/flower_city/src/main/java/com/dg/core/controller/UserController.java +++ b/flower_city/src/main/java/com/dg/core/controller/UserController.java @@ -9,6 +9,7 @@ import com.dg.core.manager.TokenManager; import com.dg.core.service.IHuaChengSysUserService; import com.dg.core.util.SmsUtil; +import com.dg.core.util.Snowflake; import com.dg.core.util.TableDataInfo; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -100,6 +101,7 @@ map.put("token", token); map.put("userId", user.getUserId()); map.put("userName", user.getUserName()); + map.put("permission", user.getPermission()); return ResultData.success(map); } @@ -125,6 +127,7 @@ map.put("token", token); map.put("userId", user.getUserId()); map.put("userName", user.getUserName()); + map.put("permission", user.getPermission()); return ResultData.success(map); } @@ -171,9 +174,9 @@ Assert.notNull(pageNum, "pageNum can not be empty"); Assert.notNull(pageSize, "pageSize can not be empty"); Page<SysUser> pageParam = new Page<>(pageNum,pageSize); - List<SysUser> list = IUserService.selectConfigList(pageParam,pageSize,"1"); + List<SysUser> list = IUserService.selectConfigList(pageParam,pageSize,"3"); - int num=IUserService.selectNum("1"); + int num=IUserService.selectNum("3"); return getDataTable(list,num); } @@ -206,12 +209,18 @@ return error("昵称不能为空"); } - SysUser user = IUserService.getUserByAccount(config.getLoginName()); + if(StringUtils.isEmpty(config.getPhonenumber())) + { + return error("手机号不能为空"); + } + + SysUser user = IUserService.selectData("",config.getPhonenumber()); if (user != null) { //提示用户名或密码错误 return error("该账户已存在!"); } + config.setUserId(Snowflake.getId()); config.setUserType("3"); config.setCreateTime(LocalDateTime.now()); -- Gitblit v1.7.1