You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
StpUtil.getSessionByLoginId(1, true).set(UserConst.ROLE_LIST, new String[]{"role"});
StpUtil.getSessionByLoginId(1, true).set(UserConst.PERMISSION_LIST, new String[]{"permission"});
2.要么一直沿用一个SaSession
SaSession saSession = StpUtil.getSessionByLoginId(1, true);
saSession.set(UserConst.ROLE_LIST, new String[]{"role"});
saSession.set(UserConst.PERMISSION_LIST, new String[]{"permission"});
使用版本:
<sa-token>1.39.0</sa-token>
涉及的功能模块:
测试步骤:
SaSession的set方法执行时内部update更新问题
1.要么全部重新获取保证是未被更改的Sasession
2.要么一直沿用一个SaSession
如果可以请在文档写明set方法内部的update方法会更新之前保存的状态。
内部update方法如果遇到多线程使用估计会导致有些未能更新至缓存;
比如两个请求同时获取到原始SaSession对象;
A请求的SaSession率先修改完成并且update,B请求的SaSession随后完成对应操作
随后观测只有B请求生效了,而A请求未能生效
The text was updated successfully, but these errors were encountered: