|
@@ -311,16 +311,16 @@ public class TenantInfoController extends BaseController {
|
|
|
|
|
|
// 修改了手机号码,清理token和WXOpenId
|
|
|
if (StringUtils.isNotEmpty(sysUser.getPhone()) && !user.getPhone().equals(sysUser.getPhone())) {
|
|
|
- // 清除登录token信息
|
|
|
- TenantStaff tenantStaff = tenantStaffService.getByUserId(user.getId());
|
|
|
- if (tenantStaff != null) {
|
|
|
+ // 清除登录token信息,有wxOpenId说明登陆过
|
|
|
+ if (StringUtils.isNotEmpty(staff.getWxOpenid())) {
|
|
|
+ TenantStaff newStaff = tenantStaffService.getByPhone(sysUser.getPhone());
|
|
|
sysUserFeignService.exitByPhoneAndOpenId(ClientEnum.ORGANIZATION.getCode().toLowerCase(),
|
|
|
- user.getPhone(), tenantStaff.getWxOpenid());
|
|
|
+ user.getPhone(), staff.getWxOpenid());
|
|
|
+ // 清除WXOpenId
|
|
|
+ tenantStaffService.update(null, Wrappers.<TenantStaff>lambdaUpdate()
|
|
|
+ .set(TenantStaff::getWxOpenid, null)
|
|
|
+ .eq(TenantStaff::getUserId, newStaff.getUserId()));
|
|
|
}
|
|
|
- // 清除WXOpenId
|
|
|
- tenantStaffService.update(null, Wrappers.<TenantStaff>lambdaUpdate()
|
|
|
- .set(TenantStaff::getWxOpenid, null)
|
|
|
- .eq(TenantStaff::getUserId, user.getId()));
|
|
|
}
|
|
|
|
|
|
return HttpResponseResult.succeed(true);
|