Commit cebe7484 authored by 竹天卫's avatar 竹天卫

企业微信用户直接登录实验室系统,不需要手动添加,关联字段是wx_id 和企业微信的userid关联

角色是员工,工作组是客户组, 职位是员工职位, id都是2  且不允许删除,
系统管理员账号是 高伟强账号
parent af1c91a9
...@@ -125,7 +125,7 @@ public class WeiXinService { ...@@ -125,7 +125,7 @@ public class WeiXinService {
System.out.println(UserId); System.out.println(UserId);
JSONObject userJson = getUser(accessToken, UserId); JSONObject userJson = getUser(accessToken, UserId);
QueryWrapper<SysUser> wrapper = new QueryWrapper<>(); QueryWrapper<SysUser> wrapper = new QueryWrapper<>();
wrapper.eq("phone", userJson.get("mobile")); wrapper.eq("wx_id", userJson.getString("userid"));
SysUser sysUser = userService.getOne(wrapper); SysUser sysUser = userService.getOne(wrapper);
if (sysUser == null) { if (sysUser == null) {
UserQuery query = new UserQuery(); UserQuery query = new UserQuery();
...@@ -162,8 +162,6 @@ public class WeiXinService { ...@@ -162,8 +162,6 @@ public class WeiXinService {
sysUser.getName(), sysUser.getPhone()); sysUser.getName(), sysUser.getPhone());
System.out.println(token); System.out.println(token);
redisUtil.setString(sysUser.getId().toString(), token, 3600); redisUtil.setString(sysUser.getId().toString(), token, 3600);
sysUser.setWxId(UserId);
userService.updateById(sysUser);
return BaseResponse.okData(token); return BaseResponse.okData(token);
} catch (Exception e) { } catch (Exception e) {
return BaseResponse.errorMsg(e.getMessage()); return BaseResponse.errorMsg(e.getMessage());
......
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