入职流程

pull/455/head
wangchuxiao 2 years ago committed by Xinwei Xiong(cubxxw-openim)
parent d5c338dee5
commit 9d2a2804ab

@ -202,6 +202,7 @@ manager:
#app管理员userID和对应的secret 建议修改。 用于管理后台登录也可以用户管理后台对应的api
appManagerUid: [ "openIM123456","openIM654321", "openIM333", "openIMAdmin"]
secrets: [ "openIM1","openIM2", "openIM333", "openIMAdmin"]
appSysNotificationName: "系统通知"
secret: tuoyun
# 多端互踢策略

@ -117,15 +117,19 @@ func groupNotification(contentType int32, m proto.Message, sendID, groupID, recv
}
tips.JsonDetail, _ = marshaler.MarshalToString(m)
var nickname string
if utils.IsContain(sendID, config.Config.Manager.AppManagerUid) {
nickname = sendID
} else {
from, err := imdb.GetUserByUserID(sendID)
if err != nil {
log.Error(operationID, "GetUserByUserID failed ", err.Error(), sendID)
}
nickname := ""
if from != nil {
nickname = from.Nickname
}
}
to, err := imdb.GetUserByUserID(recvUserID)
if err != nil {
log.NewWarn(operationID, "GetUserByUserID failed ", err.Error(), recvUserID)

@ -176,6 +176,7 @@ type config struct {
Manager struct {
AppManagerUid []string `yaml:"appManagerUid"`
Secrets []string `yaml:"secrets"`
AppSysNotificationName string `yaml:"appSysNotificationName"`
}
Kafka struct {

@ -22,7 +22,11 @@ func init() {
}
var appMgr db.User
appMgr.UserID = v
if k == 0 {
appMgr.Nickname = config.Config.Manager.AppSysNotificationName
} else {
appMgr.Nickname = "AppManager" + utils.IntToString(k+1)
}
appMgr.AppMangerLevel = constant.AppAdmin
err = UserRegister(appMgr)
if err != nil {

Loading…
Cancel
Save