This commit is contained in:
2026-10-25 21:00:08 +08:00
parent 30e5a6bed0
commit 039528e759
9 changed files with 534 additions and 12 deletions
+6
View File
@@ -17,6 +17,12 @@ type Store interface {
Delete(ctx context.Context, key string) error
}
// MaSessionPrefix 是小程序用户会话键前缀。
const MaSessionPrefix = "ma:session:"
// MaSessionKey 拼接小程序用户会话键(token 为 Login 签发的会话凭证)。
func MaSessionKey(token string) string { return MaSessionPrefix + token }
// MemoryStore 进程内会话存储,适用于无 Redis 的本地/测试环境。
// 注意:多实例部署时各进程不共享,仅供单实例使用。
type MemoryStore struct {