util

package
v0.0.0-...-5cfecba Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2018 License: GPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const APPKEY = "3222320339d628c7d4aa099c9150bfc4" //您申请的APPKEY
View Source
const JuheURL = "http://v.juhe.cn/sms/send"

Variables

View Source
var Glog *log.Logger

Functions

func AESDecrypt

func AESDecrypt(crypted, key []byte) ([]byte, error)

func Get

func Get(apiURL string, params url.Values) (rs []byte, err error)

get 网络请求

func GetIDCardText

func GetIDCardText(imageBase64 string) (gjson.Result, error)

func GetLocation

func GetLocation() *time.Location

func GetRandomString

func GetRandomString(length int) string

生成随机字符串

func JSON

func JSON(c *gin.Context, message ResponseMesage)

func MD5

func MD5(str string) string

func Post

func Post(apiURL string, params url.Values) (rs []byte, err error)

post 网络请求 ,params 是url.Values类型

func RandNumber

func RandNumber(len int) string

func SendSMS

func SendSMS(mobile, tplId, tplValue string) error

2.发送注册短信

func TokenGen

func TokenGen(c *gin.Context, data map[string]interface{}) (string, error)

GetToken 根据用户名称生成Token

func UUID

func UUID() string

Types

type GError

type GError struct {
	Code float64
	Err  string
}

func (*GError) Error

func (err *GError) Error() string

type JwtCustomClaims

type JwtCustomClaims struct {
	Id           string `json:"id"`
	Phone        string `json:"phone"`
	ForgotPasswd bool   `json:"forgotPasswd"`
	jwt.StandardClaims
}

JwtCustomClaims are custom claims extending default ones.

type ResponseMesage

type ResponseMesage struct {
	Status  bool
	Message string
	Error   error
	Data    interface{}
}

Jump to

Keyboard shortcuts

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