|
@@ -1,6 +1,7 @@
|
|
package com.yonge.cooleshow.tenant.controller;
|
|
package com.yonge.cooleshow.tenant.controller;
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
import com.alibaba.fastjson.JSON;
|
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
import com.yonge.cooleshow.auth.api.client.SysUserFeignService;
|
|
import com.yonge.cooleshow.auth.api.client.SysUserFeignService;
|
|
import com.yonge.cooleshow.auth.api.entity.SysUser;
|
|
import com.yonge.cooleshow.auth.api.entity.SysUser;
|
|
import com.yonge.cooleshow.biz.dal.entity.TenantInfo;
|
|
import com.yonge.cooleshow.biz.dal.entity.TenantInfo;
|
|
@@ -107,7 +108,7 @@ public class TenantInfoController extends BaseController {
|
|
public HttpResponseResult<Boolean> updateTenantInfo(@Valid @RequestBody TenantInfoVo.TenantInfo info) {
|
|
public HttpResponseResult<Boolean> updateTenantInfo(@Valid @RequestBody TenantInfoVo.TenantInfo info) {
|
|
|
|
|
|
TenantInfo tenantInfo = JSON.parseObject(info.jsonString(), TenantInfo.class);
|
|
TenantInfo tenantInfo = JSON.parseObject(info.jsonString(), TenantInfo.class);
|
|
- tenantInfoService.updateById(tenantInfo);
|
|
|
|
|
|
+ tenantInfoService.updateById(tenantInfo);
|
|
|
|
|
|
return HttpResponseResult.succeed(true);
|
|
return HttpResponseResult.succeed(true);
|
|
|
|
|
|
@@ -308,6 +309,20 @@ public class TenantInfoController extends BaseController {
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ // 修改了手机号码,清理token和WXOpenId
|
|
|
|
+ if (StringUtils.isNotEmpty(sysUser.getPhone()) && !user.getPhone().equals(sysUser.getPhone())) {
|
|
|
|
+ // 清除登录token信息,有wxOpenId说明登陆过
|
|
|
|
+ if (StringUtils.isNotEmpty(staff.getWxOpenid())) {
|
|
|
|
+ TenantStaff newStaff = tenantStaffService.getByPhone(sysUser.getPhone());
|
|
|
|
+ sysUserFeignService.exitByPhoneAndOpenId(ClientEnum.ORGANIZATION.getCode().toLowerCase(),
|
|
|
|
+ user.getPhone(), staff.getWxOpenid());
|
|
|
|
+ // 清除WXOpenId
|
|
|
|
+ tenantStaffService.update(null, Wrappers.<TenantStaff>lambdaUpdate()
|
|
|
|
+ .set(TenantStaff::getWxOpenid, null)
|
|
|
|
+ .eq(TenantStaff::getUserId, newStaff.getUserId()));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
return HttpResponseResult.succeed(true);
|
|
return HttpResponseResult.succeed(true);
|
|
}
|
|
}
|
|
}
|
|
}
|