当前位置: 首页 > news >正文

E10 通过RPC实现账号批量锁定与解锁

需求背景:账号信息由三方系统管理,包含账号状态,所以需要通过提供给三方的 Rest 接口中,实现账号锁定与解锁。

参考基线版本:10.0.2506.01,过低的版本可能无法使用。

锁定分为两种:
(1)租户级别锁定,用户在某个租户中账号被锁定,可以切换到其他租户继续登录
(2)系统级别锁定,用户无法登录任意租户系统

如果调用 RPC 接口出现以下问题,可以联系注册登录模块人员出包升级 weaver-passport 处理。

相关代码 【lock-租户级别锁定、unlock-租户级别解锁、sysLock-系统级锁定、sysUnLock-系统级解锁】

 @GetMapping("/lock")public WeaResult<BasicCommonI18nResult<Boolean>> lock() {log.error("当前要锁定账户 ---> ");Long employeeId = Convert.toLong("1161719504622239745");Long userId = Convert.toLong("6855375158169694729");BatchBasicCommonUserLockDto batchDto = new BatchBasicCommonUserLockDto().setOnceOffLine(true);//是否下线List<BasicCommonUserLockDto> dtoList = new ArrayList<>();BasicCommonUserLockDto dto = new BasicCommonUserLockDto().setEmployeeId(employeeId).setTenantKey("tv6f3n07lw").setUserId(userId).setLockType("EMPLOYEE_LOCK").setSourceType("SECOND_DEVELOP");dtoList.add(dto);batchDto.setDtoList(dtoList);BasicCommonI18nResult<Boolean> result = remotePassportBaseService.batchCommonLockUser(batchDto);log.error("锁定账户结果 ---> " + result);return WeaResult.success(result);}@GetMapping("/unlock")public WeaResult<BasicCommonI18nResult<Boolean>> unlock() {log.error("当前要解锁账户 ---> ");Long employeeId = Convert.toLong("1161719504622239745");BatchBasicCommonUserLockDto batchDto = new BatchBasicCommonUserLockDto();BasicCommonUserLockDto dto = new BasicCommonUserLockDto().setEmployeeId(employeeId).setLockType("EMPLOYEE_LOCK");batchDto.setDtoList(Collections.singletonList(dto));BasicCommonI18nResult<Boolean> result = remotePassportBaseService.batchCommonUnLockUser(batchDto);log.error("解锁账户结果 ---> " + result);return WeaResult.success(result);}@GetMapping("sysLock")public WeaResult<BasicCommonI18nResult<Boolean>> sysLock() {log.error("系统级锁定账户 ---> ");Long employeeId = Convert.toLong("1161719504622239745");Long userId = Convert.toLong("6855375158169694729");BatchBasicCommonUserLockDto batchDto = new BatchBasicCommonUserLockDto().setOffLineMsg("您的账号已被管理员锁定").setOffLineI18nId("175861").setOnceOffLine(true);List<BasicCommonUserLockDto> dtoList = new ArrayList<>();BasicCommonUserLockDto dto = new BasicCommonUserLockDto().setEmployeeId(employeeId).setTenantKey("all_teams").setUserId(userId).setLockType("ACCOUNT_LOCK").setSourceType("SECOND_DEVELOP");dtoList.add(dto);batchDto.setDtoList(dtoList);BasicCommonI18nResult<Boolean> result = remotePassportBaseService.batchCommonLockUser(batchDto);log.error("系统级锁定结果 ---> " + result);return WeaResult.success(result);}@GetMapping("/sysUnLock")public WeaResult<BasicCommonI18nResult<Boolean>> sysUnLock() {log.error("系统级解锁 --->");Long userId = Convert.toLong("6855375158169694729");BatchBasicCommonUserLockDto batchDto = new BatchBasicCommonUserLockDto();BasicCommonUserLockDto dto = new BasicCommonUserLockDto().setUserId(userId).setLockType("ACCOUNT_LOCK");batchDto.setDtoList(Collections.singletonList(dto));BasicCommonI18nResult<Boolean> result = remotePassportBaseService.batchCommonUnLockUser(batchDto);log.error("系统级解锁结果 ---> " + result);return WeaResult.success(result);}
http://www.lryc.cn/news/627084.html

相关文章:

  • 宝塔部署 Nuxt3
  • 透传 Attributes(详细解析)1
  • 新手向:Python制作简易音乐播放器
  • 软考中级习题与解答——第一章_数据结构与算法基础(1)
  • PyTorch 深度学习常用函数总结
  • Dify 从入门到精通(第 45/100 篇):Dify 的外部系统集成
  • AI 伦理的 “灰色地带”:当算法拥有决策权,公平与隐私该如何平衡?
  • 【C++】模版(初阶)
  • C++ std::optional 深度解析与实践指南
  • kotlin 协程笔记
  • 用Python合成瀑布流图片
  • 【数据类型】
  • python的物资管理系统
  • Linux服务器性能优化总结
  • 压缩--RAR、7-Zip工具使用
  • Kafka如何保证「消息不丢失」,「顺序传输」,「不重复消费」,以及为什么会发生重平衡(reblanace)
  • 中国大学MOOC-C语言第九周指针(上)
  • 360报毒HEUR/QVM03.0.7EBB.Malware.Gen问题
  • lock4j 库中的 @Lock4j 注解进行全面的概述和深度的源码级剖析。
  • Ubuntu实现程序开机自动运行
  • Windows 如何清理右键菜单?电脑桌面右键菜单里出现一个清理内存 怎么去掉?
  • 强制重启导致Ubuntu24.04LTS amd的WIFI无法使用的解决方案
  • 电芯自动分选装盒机:高效整合分选与包装的智能化解决方案
  • unfold 切图像,图形transformer的切割操作
  • 【蒸蒸日上】军八武将篇——标1
  • 仿真驱动的AI自动驾驶汽车安全设计与测试
  • 30.Linux cobbler自动化部署
  • 计算机网络基础复习
  • 对象存储 COS 端到端质量系列——终端 COS SDK 网络优化
  • 【自记】Power BI 中 ALL、ALLSELECTED、ALLEXCEPT、ALLNOBLANKROW 的区别说明