diff --git a/comm/core.go b/comm/core.go index 9e922bdec..a6d174229 100644 --- a/comm/core.go +++ b/comm/core.go @@ -42,6 +42,7 @@ type IUserSession interface { GetUserId() string GetIP() string GetGatewayServiceId() string + IsLogin() bool Build(uid string) (err error) UnBuild(ServiceMethod string, msg proto.Message) (err error) SendMsg(mainType, subType string, code pb.ErrorCode, msg proto.Message) (err error) diff --git a/comm/usersession.go b/comm/usersession.go index 44a961e51..f8ecb4d27 100644 --- a/comm/usersession.go +++ b/comm/usersession.go @@ -42,6 +42,10 @@ func (this *UserSession) GetGatewayServiceId() string { return this.GatewayServiceId } +func (this *UserSession) IsLogin() bool { + return this.UserId != "" +} + func (this *UserSession) Build(uid string) (err error) { reply := &pb.RPCMessageReply{} if err := this.service.RpcCallById(this.GatewayServiceId, string(Rpc_GatewayAgentBuild), context.Background(), &pb.AgentBuildReq{ diff --git a/pb/proto/user_db.proto b/pb/proto/user_db.proto index 7a239c802..8c042169e 100644 --- a/pb/proto/user_db.proto +++ b/pb/proto/user_db.proto @@ -9,7 +9,7 @@ message Cache_UserData { message DB_UserData { string UserId = 1; //tags:{bson:"_id"}动态Id - string account = 2; + string Account = 2; string NiceName = 3; string Email = 4; string Password = 5;