同步信息
parent
127aaf648f
commit
b6cb0987e4
|
|
@ -46,11 +46,16 @@ public class TokenController
|
||||||
String token = SecurityUtils.getToken(request);
|
String token = SecurityUtils.getToken(request);
|
||||||
if (StringUtils.isNotEmpty(token))
|
if (StringUtils.isNotEmpty(token))
|
||||||
{
|
{
|
||||||
String username = JwtUtils.getUserName(token);
|
try{
|
||||||
// 删除用户缓存记录
|
String username = JwtUtils.getUserName(token);
|
||||||
AuthUtil.logoutByToken(token);
|
// 删除用户缓存记录
|
||||||
// 记录用户退出日志
|
AuthUtil.logoutByToken(token);
|
||||||
sysLoginService.logout(username);
|
// 记录用户退出日志
|
||||||
|
sysLoginService.logout(username);
|
||||||
|
}catch (Exception e){
|
||||||
|
System.out.println(e.getMessage());
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return R.ok();
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -12,4 +12,6 @@ public class SyncGoUser {
|
||||||
private String remark;
|
private String remark;
|
||||||
private String avatar;
|
private String avatar;
|
||||||
private Integer status;
|
private Integer status;
|
||||||
|
private String openId;
|
||||||
|
private String unionId;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ import java.util.stream.Collectors;
|
||||||
import javax.validation.Validator;
|
import javax.validation.Validator;
|
||||||
|
|
||||||
import cn.hutool.system.UserInfo;
|
import cn.hutool.system.UserInfo;
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.github.pagehelper.Page;
|
import com.github.pagehelper.Page;
|
||||||
import com.ruoyi.system.api.domain.KSysUserAccount;
|
import com.ruoyi.system.api.domain.KSysUserAccount;
|
||||||
import com.ruoyi.system.domain.SyncGoUser;
|
import com.ruoyi.system.domain.SyncGoUser;
|
||||||
|
|
@ -411,7 +412,11 @@ public class SysUserServiceImpl implements ISysUserService
|
||||||
syncGoUser.setLastIp(user.getLoginIp());
|
syncGoUser.setLastIp(user.getLoginIp());
|
||||||
syncGoUser.setRemark(user.getRemark());
|
syncGoUser.setRemark(user.getRemark());
|
||||||
syncGoUser.setAvatar(user.getAvatar());
|
syncGoUser.setAvatar(user.getAvatar());
|
||||||
syncGoUser.setStatus(Objects.equals(user.getStatus(), "正常") ?0:1);
|
syncGoUser.setStatus(Objects.equals(user.getStatus(), "1") ?1:0);
|
||||||
|
if (user.getSysUserAccount() != null) {
|
||||||
|
syncGoUser.setUnionId(user.getSysUserAccount().getWxUnionId());
|
||||||
|
syncGoUser.setOpenId(user.getSysUserAccount().getRoutineOpenid());
|
||||||
|
}
|
||||||
ResponseEntity<String> response = restTemplate.postForEntity(url, syncGoUser, String.class);
|
ResponseEntity<String> response = restTemplate.postForEntity(url, syncGoUser, String.class);
|
||||||
// 检查响应状态码
|
// 检查响应状态码
|
||||||
if (response.getStatusCode().is2xxSuccessful()) {
|
if (response.getStatusCode().is2xxSuccessful()) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue