入职流程

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

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

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

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

Loading…
Cancel
Save