示例#1
0
 def Login(self, request, context):
     login_result = global_variables._user_session.login(
         request.Email, request.Password)
     if login_result['code'] == 0:
         return GRPCServer_pb2.LoginResult(
             Succeed=True,
             SessionId=login_result['session_id'],
             FirstName=login_result['firstname'],
             LastName=login_result['lastname'],
             Error=0)
     else:
         return GRPCServer_pb2.LoginResult(Succeed=False,
                                           SessionId=None,
                                           FirstName=None,
                                           LastName=None,
                                           Error=login_result['code'])
示例#2
0
 def Login(self, request, context):
     login_result = server_init._user_session.login(request.Email, request.Password)
     if login_result['code'] == 0:
         server_init._log = open(config.efs_root + '/' + login_result['session_id'] + '.log', 'w')
         return GRPCServer_pb2.LoginResult(
             Succeed = True, 
             SessionId = login_result['session_id'],
             FirstName = login_result['firstname'],
             LastName =  login_result['lastname'],
             Error = 0)
     else:
         return GRPCServer_pb2.LoginResult(
             Succeed = False, 
             SessionId = None,
             FirstName = None,
             LastName = None,
             Error = login_result['code'])