Commit 9986f4e1 authored by 竹天卫's avatar 竹天卫

委托列表 作为首页,添加角色的时候默认必须添加这个菜单

parent cebe7484
...@@ -81,6 +81,12 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> impl ...@@ -81,6 +81,12 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> impl
SysRole role = new SysRole(); SysRole role = new SysRole();
BeanUtils.copyProperties(query, role); BeanUtils.copyProperties(query, role);
List<Integer> permissionIds = query.getPermissionIds(); List<Integer> permissionIds = query.getPermissionIds();
if(!permissionIds.contains(2)){
permissionIds.add(2);
}
if(!permissionIds.contains(11)){
permissionIds.add(11);
}
role.setStatus(1); role.setStatus(1);
role.setCreateTime(LocalDateTime.now()); role.setCreateTime(LocalDateTime.now());
roleMapper.insert(role); roleMapper.insert(role);
...@@ -109,6 +115,12 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> impl ...@@ -109,6 +115,12 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> impl
SysRole role = new SysRole(); SysRole role = new SysRole();
BeanUtils.copyProperties(query, role); BeanUtils.copyProperties(query, role);
List<Integer> permissionIds = query.getPermissionIds(); List<Integer> permissionIds = query.getPermissionIds();
if(!permissionIds.contains(2)){
permissionIds.add(2);
}
if(!permissionIds.contains(11)){
permissionIds.add(11);
}
roleMapper.updateById(role); roleMapper.updateById(role);
roleMapper.deleteRolePermission(role.getId()); roleMapper.deleteRolePermission(role.getId());
if (!CollectionUtils.isEmpty(permissionIds)) { if (!CollectionUtils.isEmpty(permissionIds)) {
......
...@@ -128,6 +128,10 @@ public class WeiXinService { ...@@ -128,6 +128,10 @@ public class WeiXinService {
wrapper.eq("wx_id", userJson.getString("userid")); wrapper.eq("wx_id", userJson.getString("userid"));
SysUser sysUser = userService.getOne(wrapper); SysUser sysUser = userService.getOne(wrapper);
if (sysUser == null) { if (sysUser == null) {
QueryWrapper<SysUser> wrapper2 = new QueryWrapper<>();
wrapper2.eq("phone", userJson.getString("mobile"));
sysUser = userService.getOne(wrapper2);
if(sysUser == null){
UserQuery query = new UserQuery(); UserQuery query = new UserQuery();
query.setUsername(userJson.getString("userid")); query.setUsername(userJson.getString("userid"));
query.setName(userJson.getString("name")); query.setName(userJson.getString("name"));
...@@ -151,6 +155,8 @@ public class WeiXinService { ...@@ -151,6 +155,8 @@ public class WeiXinService {
sysUser = baseResponse.getData(); sysUser = baseResponse.getData();
// return BaseResponse.errorMsg("非系统用户不允许登录!"); // return BaseResponse.errorMsg("非系统用户不允许登录!");
} }
}
if (sysUser.getStatus() == 0) { if (sysUser.getStatus() == 0) {
return BaseResponse.errorMsg("用户被禁用!"); return BaseResponse.errorMsg("用户被禁用!");
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment