pull/241/head
skiffer-git 3 years ago
parent 8849cd46c9
commit 9d84bf8f4c

@ -70,11 +70,11 @@ kafka:
#如果是单机模式用0.0.0.0或者不填,默认即可
serverip: 0.0.0.0
#作为rpc时注册到etcd的地址单机默认即可如果是集群部署需要修改具体使用内网地址还是外网地址要依情况而定目的是api/gateway能访问到
rpcRegisterIP: 127.0.0.1
#默认即可
listenIP: 0.0.0.0
# endpoints 内部组件间访问的端点host名称访问时可以内部直接访问 host:port 来访问
endpoints:
api: openim_api

@ -5,6 +5,7 @@ import (
"Open_IM/pkg/common/constant"
"Open_IM/pkg/common/db"
"Open_IM/pkg/common/log"
"Open_IM/pkg/utils"
"github.com/gin-gonic/gin"
"net/http"
@ -21,12 +22,16 @@ type paramsCertification struct {
func Verify(c *gin.Context) {
params := paramsCertification{}
operationID := params.OperationID
if operationID == "" {
operationID = utils.OperationIDGenerator()
}
if err := c.BindJSON(&params); err != nil {
log.NewError("", "request params json parsing failed", "", "err", err.Error())
log.NewError(operationID, "request params json parsing failed", "", "err", err.Error())
c.JSON(http.StatusBadRequest, gin.H{"errCode": constant.FormattingError, "errMsg": err.Error()})
return
}
log.NewInfo("recv req: ", params)
log.NewInfo(operationID, "recv req: ", params)
var account string
if params.Email != "" {
@ -57,7 +62,7 @@ func Verify(c *gin.Context) {
}
code, err := db.DB.GetAccountCode(accountKey)
log.NewInfo(params.OperationID, "redis phone number and verificating Code", accountKey, code, params)
log.NewInfo(params.OperationID, "redis phone number and verificating Code", "key: ", accountKey, "code: ", code, "params: ", params)
if err != nil {
log.NewError(params.OperationID, "Verification code expired", accountKey, "err", err.Error())
data := make(map[string]interface{})

Loading…
Cancel
Save