|
|
@ -24,7 +24,7 @@ type adminCMSServer struct {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func NewAdminCMSServer(port int) *adminCMSServer {
|
|
|
|
func NewAdminCMSServer(port int) *adminCMSServer {
|
|
|
|
log.NewPrivateLog("AdminCMS")
|
|
|
|
log.NewPrivateLog(constant.LogFileName)
|
|
|
|
return &adminCMSServer{
|
|
|
|
return &adminCMSServer{
|
|
|
|
rpcPort: port,
|
|
|
|
rpcPort: port,
|
|
|
|
rpcRegisterName: config.Config.RpcRegisterName.OpenImAdminCMSName,
|
|
|
|
rpcRegisterName: config.Config.RpcRegisterName.OpenImAdminCMSName,
|
|
|
@ -66,7 +66,7 @@ func (s *adminCMSServer) Run() {
|
|
|
|
func (s *adminCMSServer) AdminLogin(_ context.Context, req *pbAdminCMS.AdminLoginReq) (*pbAdminCMS.AdminLoginResp, error) {
|
|
|
|
func (s *adminCMSServer) AdminLogin(_ context.Context, req *pbAdminCMS.AdminLoginReq) (*pbAdminCMS.AdminLoginResp, error) {
|
|
|
|
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req.String())
|
|
|
|
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req.String())
|
|
|
|
resp := &pbAdminCMS.AdminLoginResp{}
|
|
|
|
resp := &pbAdminCMS.AdminLoginResp{}
|
|
|
|
for i, adminID := range config.Config.Manager.AppManagerUid{
|
|
|
|
for i, adminID := range config.Config.Manager.AppManagerUid {
|
|
|
|
if adminID == req.AdminID && config.Config.Manager.Secrets[i] == req.Secret {
|
|
|
|
if adminID == req.AdminID && config.Config.Manager.Secrets[i] == req.Secret {
|
|
|
|
token, expTime, err := token_verify.CreateToken(adminID, constant.SingleChatType)
|
|
|
|
token, expTime, err := token_verify.CreateToken(adminID, constant.SingleChatType)
|
|
|
|
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "generate token success", "token: ", token, "expTime:", expTime)
|
|
|
|
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "generate token success", "token: ", token, "expTime:", expTime)
|
|
|
|