GITLAB

aarongao / leyoutu_server

Sign in
  • Sign in
  • Project
  • Files
  • Commits
  • Network
  • Graphs
  • Issues 0
  • Merge Requests 0
  • Wiki
  • leyoutu_server
  • Lib
  • Token
  • token.go
  • f74be2a9   .. Browse Code ยป
    aarongao
    2020-02-28 13:33:29 +0800  
token.go 290 Bytes
Edit Raw Blame History
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
package Token

import (
	"letu/DB"
	"time"
)

func GetToken(mobile string) string {
	token := DB.Redis.Get("token_" + mobile)
	if token == nil {
		return ""
	}
	return token.(string)
}

func SaveToken(mobile, token string) {
	DB.Redis.Set("token_"+mobile, token, time.Second*3600*24*365)
}