fix: meta_sql文件中windows换行符不同问题

This commit is contained in:
meilin.huang
2023-06-17 16:04:21 +08:00
parent 0eca951465
commit 64f8f9a200
6 changed files with 18 additions and 11 deletions

View File

@@ -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())
}