mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-06 04:15:46 +08:00
Organization
This commit is contained in:
parent
066fae0b74
commit
2d57f742e2
@ -204,6 +204,9 @@ secret: tuoyun
|
|||||||
# 1:多平台登录:Android、iOS、Windows、Mac 每种平台只能一个在线,web端可以多个同时在线
|
# 1:多平台登录:Android、iOS、Windows、Mac 每种平台只能一个在线,web端可以多个同时在线
|
||||||
multiloginpolicy: 1
|
multiloginpolicy: 1
|
||||||
|
|
||||||
|
#chat log insert to db
|
||||||
|
chatPersistenceMysql: true
|
||||||
|
|
||||||
#token config
|
#token config
|
||||||
tokenpolicy:
|
tokenpolicy:
|
||||||
accessSecret: "open_im_server" #token生成相关,默认即可
|
accessSecret: "open_im_server" #token生成相关,默认即可
|
||||||
|
@ -23,8 +23,9 @@ func UserRegister(c *gin.Context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if params.Secret != config.Config.Secret {
|
if params.Secret != config.Config.Secret {
|
||||||
log.NewError(params.OperationID, "params.Secret != config.Config.Secret", params.Secret, config.Config.Secret)
|
errMsg := " params.Secret != config.Config.Secret "
|
||||||
c.JSON(http.StatusBadRequest, gin.H{"errCode": 401, "errMsg": "not authorized"})
|
log.NewError(params.OperationID, errMsg, params.Secret, config.Config.Secret)
|
||||||
|
c.JSON(http.StatusBadRequest, gin.H{"errCode": 401, "errMsg": errMsg})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
req := &rpc.UserRegisterReq{UserInfo: &open_im_sdk.UserInfo{}}
|
req := &rpc.UserRegisterReq{UserInfo: &open_im_sdk.UserInfo{}}
|
||||||
@ -36,7 +37,7 @@ func UserRegister(c *gin.Context) {
|
|||||||
client := rpc.NewAuthClient(etcdConn)
|
client := rpc.NewAuthClient(etcdConn)
|
||||||
reply, err := client.UserRegister(context.Background(), req)
|
reply, err := client.UserRegister(context.Background(), req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.NewError(req.OperationID, "call rpc err ", err)
|
log.NewError(req.OperationID, "call rpc err ", err.Error())
|
||||||
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "internal service err"})
|
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "internal service err"})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -56,11 +56,15 @@ func (pc *PersistentConsumerHandler) handleChatWs2Mysql(msg []byte, msgKey strin
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if tag {
|
if tag {
|
||||||
|
if config.Config.ChatPersistenceMysql == true {
|
||||||
log.NewInfo(msgFromMQ.OperationID, "msg_transfer msg persisting", string(msg))
|
log.NewInfo(msgFromMQ.OperationID, "msg_transfer msg persisting", string(msg))
|
||||||
if err = im_mysql_msg_model.InsertMessageToChatLog(msgFromMQ); err != nil {
|
if err = im_mysql_msg_model.InsertMessageToChatLog(msgFromMQ); err != nil {
|
||||||
log.NewError(msgFromMQ.OperationID, "Message insert failed", "err", err.Error(), "msg", msgFromMQ.String())
|
log.NewError(msgFromMQ.OperationID, "Message insert failed", "err", err.Error(), "msg", msgFromMQ.String())
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
log.Debug(msgFromMQ.OperationID, "don't insert to db", string(msg))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -176,6 +176,7 @@ type config struct {
|
|||||||
AppManagerUid []string `yaml:"appManagerUid"`
|
AppManagerUid []string `yaml:"appManagerUid"`
|
||||||
Secrets []string `yaml:"secrets"`
|
Secrets []string `yaml:"secrets"`
|
||||||
}
|
}
|
||||||
|
|
||||||
Kafka struct {
|
Kafka struct {
|
||||||
Ws2mschat struct {
|
Ws2mschat struct {
|
||||||
Addr []string `yaml:"addr"`
|
Addr []string `yaml:"addr"`
|
||||||
@ -193,6 +194,8 @@ type config struct {
|
|||||||
}
|
}
|
||||||
Secret string `yaml:"secret"`
|
Secret string `yaml:"secret"`
|
||||||
MultiLoginPolicy int `yaml:"multiloginpolicy"`
|
MultiLoginPolicy int `yaml:"multiloginpolicy"`
|
||||||
|
ChatPersistenceMysql bool `yaml:"chatPersistenceMysql"`
|
||||||
|
|
||||||
TokenPolicy struct {
|
TokenPolicy struct {
|
||||||
AccessSecret string `yaml:"accessSecret"`
|
AccessSecret string `yaml:"accessSecret"`
|
||||||
AccessExpire int64 `yaml:"accessExpire"`
|
AccessExpire int64 `yaml:"accessExpire"`
|
||||||
|
Loading…
x
Reference in New Issue
Block a user