helper

package
v0.0.0-...-07bc221 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 18, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrTokenNotExists = errors.New("token not exists")

	ErrOpenIdExists   = errors.New("openId exists")
	ErrUniqueIdExists = errors.New("uniqueId exists")
)

Functions

func DeleteToken

func DeleteToken(ctx context.Context, appId string, token string) error

func GenerateToken

func GenerateToken(ctx context.Context, appId string, userId int) (string, error)

GenerateToken @description: v1 获取token (用于跳转redirect_uri携带)

func GetUserIdByToken

func GetUserIdByToken(ctx context.Context, appId string, token string) (int, error)

GetUserIdByToken 通过Token和appid 获取用户ID

Types

type ApiErr

type ApiErr = error

type UserIdsStruct

type UserIdsStruct struct {
	OpenId   string `json:"openId"`
	UniqueId string `json:"uniqueId"`
}

func GetUserIds

func GetUserIds(appId string, userId int) (UserIdsStruct, error)

GetUserIds @description 获取用户ID

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL