mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-03 04:10:20 +08:00
Add alipay provider.
This commit is contained in:
@ -23,6 +23,7 @@ import (
|
||||
"os"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
"unicode"
|
||||
|
||||
"github.com/google/uuid"
|
||||
@ -88,6 +89,17 @@ func GenerateId() string {
|
||||
return uuid.NewString()
|
||||
}
|
||||
|
||||
func GenerateTimeId() string {
|
||||
timestamp := time.Now().Unix()
|
||||
tm := time.Unix(timestamp, 0)
|
||||
t := tm.Format("20060102_150405")
|
||||
|
||||
random := uuid.NewString()[0:7]
|
||||
|
||||
res := fmt.Sprintf("%s_%s", t, random)
|
||||
return res
|
||||
}
|
||||
|
||||
func GetId(name string) string {
|
||||
return fmt.Sprintf("admin/%s", name)
|
||||
}
|
||||
|
Reference in New Issue
Block a user