feat(app): update
This commit is contained in:
4
pkg/cache/user/user.go
vendored
4
pkg/cache/user/user.go
vendored
@ -1,9 +1,9 @@
|
||||
package cache_user
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"servicebase/pkg/cache"
|
||||
"servicebase/pkg/tools"
|
||||
"fmt"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
@ -14,11 +14,9 @@ import (
|
||||
const key = "user:models"
|
||||
const keyToken = "user:token"
|
||||
|
||||
// 用户当前所在的房间ID + userid = chatroomid
|
||||
const ACCESSTOKEN_KEY_PREV = "ACCESSTOKEN_"
|
||||
const ACCESSTOKEN_EXPIRE_DURATION = time.Hour * 24 * 180
|
||||
|
||||
// 通过token获取userId
|
||||
func IdByToken(token string) (userId string) {
|
||||
if len(token) == 0 {
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user