动态

列表
创建 时间

登錄認證-下篇:基於 Redis 實現共享session登錄

將驗證碼 (session.setAttribute("code", code));用户信息 (session.setAttribute("user", userDTO))改為存入redis中 將隨機生成的token作為登錄憑證,放在請求頭中的authorization字段 並設置兩層攔截器,解決狀態登錄刷新的問題 業務流程圖1 業務流程圖2 具體實現: UserServiceI

创建 时间

redis實現分佈式鎖1

在集羣下的併發問題: 業務流程: 具體實現: ILock 點擊查看代碼 package com.hmdp.utils; public interface ILock { // 獲取鎖 boolean tryLock(long timeoutSec); // 釋放鎖 void unlock(); } SimpleRedisLock 點擊查看代