代码调整

This commit is contained in:
2026-06-03 23:13:12 +08:00
parent c47f12a740
commit 7444fc5c48
9 changed files with 31 additions and 900 deletions
+14 -13
View File
@@ -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 {