Initial commit (code only without large binaries)

This commit is contained in:
robin
2026-02-15 18:58:44 +08:00
commit 35df75498f
9442 changed files with 1495866 additions and 0 deletions

View File

@@ -0,0 +1,41 @@
// Copyright 2023 GoEdge CDN goedge.cdn@gmail.com. All rights reserved. Official site: https://goedge.cn .
package mobileverify
import (
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
"github.com/TeaOSLab/EdgeCommon/pkg/userconfigs"
"github.com/TeaOSLab/EdgeUser/internal/web/actions/actionutils"
"regexp"
)
type VerifyAction struct {
actionutils.ParentAction
}
func (this *VerifyAction) RunPost(params struct {
Mobile string
Code string
}) {
if len(params.Code) != userconfigs.MobileVerificationCodeLength ||
!regexp.MustCompile(`^\d+$`).MatchString(params.Code) {
this.FailField("code", "请输入正确的验证码")
return
}
resp, err := this.RPC().UserMobileVerificationRPC().VerifyUserMobile(this.UserContext(), &pb.VerifyUserMobileRequest{
Mobile: params.Mobile,
Code: params.Code,
})
if err != nil {
this.ErrorPage(err)
return
}
if len(resp.ErrorCode) > 0 {
this.FailField("code", resp.ErrorMessage)
return
}
this.Success()
}