mirror of
https://gitee.com/dromara/mayfly-go
synced 2025-12-31 03:46:34 +08:00
fix: meta_sql文件中windows换行符不同问题
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
package otp
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
otp_t "github.com/pquerna/otp"
|
||||
totp_t "github.com/pquerna/otp/totp"
|
||||
)
|
||||
@@ -17,3 +19,7 @@ func Validate(code string, secret string) bool {
|
||||
}
|
||||
return totp_t.Validate(code, secret)
|
||||
}
|
||||
|
||||
func GenTotpCode(code string, secret string) (string, error) {
|
||||
return totp_t.GenerateCode(secret, time.Now())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user