mirror of
https://github.com/bjdgyc/anylink.git
synced 2025-08-08 08:22:26 +08:00
修复freeotp扫码问题
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"net/url"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"text/template"
|
"text/template"
|
||||||
@@ -141,7 +142,7 @@ func UserOtpQr(w http.ResponseWriter, r *http.Request) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
issuer := base.Cfg.Issuer
|
issuer := url.QueryEscape(base.Cfg.Issuer)
|
||||||
qrstr := fmt.Sprintf("otpauth://totp/%s:%s?issuer=%s&secret=%s", issuer, user.Email, issuer, user.OtpSecret)
|
qrstr := fmt.Sprintf("otpauth://totp/%s:%s?issuer=%s&secret=%s", issuer, user.Email, issuer, user.OtpSecret)
|
||||||
qr, _ := qrcode.New(qrstr, qrcode.High)
|
qr, _ := qrcode.New(qrstr, qrcode.High)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user