Merge pull request #3341 from openimsdk/cherry-pick-56c5c1f

fix: delete token by correct platformID && feat: adminToken can be re… [Created by @icey-yu from #3313]
This commit is contained in:
chao
2025-05-14 16:37:55 +08:00
committed by GitHub
7 changed files with 492 additions and 45 deletions
+6 -1
View File
@@ -1,8 +1,9 @@
package cachekey
import (
"github.com/openimsdk/protocol/constant"
"strings"
"github.com/openimsdk/protocol/constant"
)
const (
@@ -13,6 +14,10 @@ func GetTokenKey(userID string, platformID int) string {
return UidPidToken + userID + ":" + constant.PlatformIDToName(platformID)
}
func GetTemporaryTokenKey(userID string, platformID int, token string) string {
return UidPidToken + ":TEMPORARY:" + userID + ":" + constant.PlatformIDToName(platformID) + ":" + token
}
func GetAllPlatformTokenKey(userID string) []string {
res := make([]string, len(constant.PlatformID2Name))
for k := range constant.PlatformID2Name {