style(backend): go fmt code

This commit is contained in:
hzb1115
2025-11-03 17:22:11 +00:00
parent d6daad5708
commit febf7f5f33
7 changed files with 164 additions and 165 deletions

View File

@@ -61,7 +61,7 @@ func GenerateOTPSecret() (string, error) {
if err != nil {
return "", err
}
key, err := totp.Generate(totp.GenerateOpts{
Issuer: OTPIssuer,
AccountName: uuid.New().String(),
@@ -69,7 +69,7 @@ func GenerateOTPSecret() (string, error) {
if err != nil {
return "", err
}
return key.Secret(), nil
}
@@ -118,4 +118,4 @@ func ValidateJWT(tokenString string) (*Claims, error) {
// GetOTPQRCodeURL 获取OTP二维码URL
func GetOTPQRCodeURL(secret, email string) string {
return fmt.Sprintf("otpauth://totp/%s:%s?secret=%s&issuer=%s", OTPIssuer, email, secret, OTPIssuer)
}
}