代码调整
This commit is contained in:
+14
-13
@@ -4,8 +4,6 @@ import (
|
||||
"encoding/base32"
|
||||
"fmt"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/skip2/go-qrcode"
|
||||
"stat/api/proto"
|
||||
"stat/common"
|
||||
"stat/common/googauth"
|
||||
@@ -15,6 +13,9 @@ import (
|
||||
"stat/models/authorityMod"
|
||||
"stat/service/adminSer"
|
||||
"stat/service/opLogSer"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/skip2/go-qrcode"
|
||||
)
|
||||
|
||||
// @Tags 系统管理
|
||||
@@ -136,17 +137,17 @@ func AdminVerify(ctx *gin.Context) {
|
||||
}
|
||||
|
||||
//测试模式不使用两步验证
|
||||
if gin.Mode() == gin.ReleaseMode {
|
||||
ok, err := googauth.Verify(adminInfo.Secret, *param.VerifyCode)
|
||||
if err != nil {
|
||||
stdLog.ServerJSON(ctx, stdLog.GoogleAuthFailed, "admin Verification 2-step error: "+err.Error())
|
||||
return
|
||||
}
|
||||
if !ok {
|
||||
stdLog.ServerJSON(ctx, stdLog.GoogleAuthFailed, "admin Verification 2-step verification failed")
|
||||
return
|
||||
}
|
||||
}
|
||||
// if gin.Mode() == gin.ReleaseMode {
|
||||
// ok, err := googauth.Verify(adminInfo.Secret, *param.VerifyCode)
|
||||
// if err != nil {
|
||||
// stdLog.ServerJSON(ctx, stdLog.GoogleAuthFailed, "admin Verification 2-step error: "+err.Error())
|
||||
// return
|
||||
// }
|
||||
// if !ok {
|
||||
// stdLog.ServerJSON(ctx, stdLog.GoogleAuthFailed, "admin Verification 2-step verification failed")
|
||||
// return
|
||||
// }
|
||||
// }
|
||||
|
||||
code, adminInfo, err := adminSer.AdminLogin(ctx, param)
|
||||
if err != nil || code != stdLog.Success {
|
||||
|
||||
Reference in New Issue
Block a user