mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-06 04:15:46 +08:00
log
This commit is contained in:
parent
8849cd46c9
commit
9d84bf8f4c
@ -70,11 +70,11 @@ kafka:
|
|||||||
#如果是单机模式,用0.0.0.0或者不填,默认即可
|
#如果是单机模式,用0.0.0.0或者不填,默认即可
|
||||||
serverip: 0.0.0.0
|
serverip: 0.0.0.0
|
||||||
|
|
||||||
|
#作为rpc时,注册到etcd的地址,单机默认即可,如果是集群部署,需要修改(具体使用内网地址还是外网地址,要依情况而定,目的是api/gateway能访问到)
|
||||||
rpcRegisterIP: 127.0.0.1
|
rpcRegisterIP: 127.0.0.1
|
||||||
|
#默认即可
|
||||||
listenIP: 0.0.0.0
|
listenIP: 0.0.0.0
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# endpoints 内部组件间访问的端点host名称,访问时,可以内部直接访问 host:port 来访问
|
# endpoints 内部组件间访问的端点host名称,访问时,可以内部直接访问 host:port 来访问
|
||||||
endpoints:
|
endpoints:
|
||||||
api: openim_api
|
api: openim_api
|
||||||
|
@ -5,6 +5,7 @@ import (
|
|||||||
"Open_IM/pkg/common/constant"
|
"Open_IM/pkg/common/constant"
|
||||||
"Open_IM/pkg/common/db"
|
"Open_IM/pkg/common/db"
|
||||||
"Open_IM/pkg/common/log"
|
"Open_IM/pkg/common/log"
|
||||||
|
"Open_IM/pkg/utils"
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"net/http"
|
"net/http"
|
||||||
@ -21,12 +22,16 @@ type paramsCertification struct {
|
|||||||
|
|
||||||
func Verify(c *gin.Context) {
|
func Verify(c *gin.Context) {
|
||||||
params := paramsCertification{}
|
params := paramsCertification{}
|
||||||
|
operationID := params.OperationID
|
||||||
|
if operationID == "" {
|
||||||
|
operationID = utils.OperationIDGenerator()
|
||||||
|
}
|
||||||
if err := c.BindJSON(¶ms); err != nil {
|
if err := c.BindJSON(¶ms); 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()})
|
c.JSON(http.StatusBadRequest, gin.H{"errCode": constant.FormattingError, "errMsg": err.Error()})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
log.NewInfo("recv req: ", params)
|
log.NewInfo(operationID, "recv req: ", params)
|
||||||
|
|
||||||
var account string
|
var account string
|
||||||
if params.Email != "" {
|
if params.Email != "" {
|
||||||
@ -57,7 +62,7 @@ func Verify(c *gin.Context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
code, err := db.DB.GetAccountCode(accountKey)
|
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 {
|
if err != nil {
|
||||||
log.NewError(params.OperationID, "Verification code expired", accountKey, "err", err.Error())
|
log.NewError(params.OperationID, "Verification code expired", accountKey, "err", err.Error())
|
||||||
data := make(map[string]interface{})
|
data := make(map[string]interface{})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user