doauth

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: May 16, 2022 License: MIT Imports: 6 Imported by: 0

README

Doauth 搞定鉴权

介绍

提供给予jwt的token的生成和token验证

支持生成token

支持验证token

安装教程
go get gitee.com/wennmu/pkg
使用说明
// 设置APPSECRET
doauth.APPSECRET = "XXX"

// 调用生成token函数
gotToken, gotExpire, err := doauth.GenToken(tt.args.uid)


// 调用验证token函数
gotUid, err := doauth.VerifyToken(tt.args.bearToken)
参阅测试
./doauth_test.go

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AppSecret = ""

全局秘钥

Functions

func GenToken

func GenToken(uid int64) (token string, expire interface{}, err error)

生成token

func VerifyToken

func VerifyToken(bearToken string) (uid int64, err error)

验证token

Types

This section is empty.

Jump to

Keyboard shortcuts

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