ming #1
@ -1619,8 +1619,13 @@ class UserService extends Service {
|
|||||||
platform_code: platformCode,
|
platform_code: platformCode,
|
||||||
});
|
});
|
||||||
|
|
||||||
// 清理缓存
|
// 清理缓存:必须带上 platformCode
|
||||||
await this.clearUserCache(user.id);
|
// clearUserCache(userId) 不带平台时只清 web/pda/mini/app/workerstation/workstation 这几个硬编码平台,
|
||||||
|
// 小程序(miniProgram)、微信(wx)等取值不在清单内且 Redis key 大小写敏感,会残留旧身份,
|
||||||
|
// 导致紧随其后的 findById 命中 5 分钟旧缓存,签发 token / 返回 user 时仍是切换前的角色。
|
||||||
|
await this.clearUserCache(user.id, platformCode);
|
||||||
|
// 同步清理平台激活上下文缓存(platform_active:{accountId}:{platformCode},30 分钟 TTL)
|
||||||
|
await this.service.systems.accountPlatform.clearPlatformCache(user.id, platformCode);
|
||||||
|
|
||||||
// 获取更新后的用户信息
|
// 获取更新后的用户信息
|
||||||
const userInfo = await this.findById(user.id);
|
const userInfo = await this.findById(user.id);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user