login_token.go 214B

123456789101112
  1. package utils
  2. import (
  3. "strings"
  4. "time"
  5. )
  6. func GenerateLoginToken(account string) string {
  7. nowStr := time.Now().Format("20060102150405")
  8. return strings.Join([]string{nowStr, RandomString(10), account}, "")
  9. }