mdw

package
v0.0.0-...-e6e6a7d Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const ContextUser = "mdw/member"
View Source
const SessionDefaultKey = "i2eco/mdw/session"

Variables

View Source
var DefaultWechatUid = "github.com/i2eco/egoshop/wechatuid"
View Source
var DefaultWechatUsername = "github.com/i2eco/egoshop/wechatUsername"

Functions

func AdminAuthed

func AdminAuthed(c *gin.Context) bool

Authed 鉴权通过

func AdminUid

func AdminUid(c *gin.Context) int

后台 Uid 返回uid

func DefaultContextUser

func DefaultContextUser(c *gin.Context) mysql.User

后台取用户

func DefaultSessionUser

func DefaultSessionUser(c *gin.Context) (mysql.User, bool)

后台取用户

func LoginAPIRequired

func LoginAPIRequired() gin.HandlerFunc

后台取用户

func LoginRequired

func LoginRequired() gin.HandlerFunc

后台取用户

func Logout

func Logout(c *gin.Context) error

Logout will clear out the session and call the Logout() user function.

func UpdateUser

func UpdateUser(c *gin.Context, a mysql.User) error

UpdateUser updates the User object stored in the session. This is useful incase a change is made to the user model that needs to persist across requests.

func ValidateGoods

func ValidateGoods(c *gin.Context) (g common.Goods, err error)

验证商品

func ValidateGoodsByParam

func ValidateGoodsByParam(gp common.Goods) (g common.Goods, err error)

func WechatAccessLogin

func WechatAccessLogin() gin.HandlerFunc

WechatAccess 微信登录校验中间件

func WechatAccessMustLogin

func WechatAccessMustLogin() gin.HandlerFunc

WechatAccess 微信登录校验中间件

func WechatMaybeUid

func WechatMaybeUid(c *gin.Context) (uid int, flag bool)

func WechatUid

func WechatUid(c *gin.Context) int

WechatUid 获取微信id

func WechatUserName

func WechatUserName(c *gin.Context) (username string)

WechatUserName 获取微信昵称

Types

This section is empty.

Jump to

Keyboard shortcuts

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