mirror of https://github.com/bjdgyc/anylink.git
修复freeotp扫码问题
This commit is contained in:
parent
35c6d80c8d
commit
eec3006b35
|
@ -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)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue