Exemple #1
0
 def post(self):
     self.setCorsHeader()
     username = self.request.get('username')
     password = self.request.get('password')
     status = self.isParamaterLegal(username,password)
     if status == self.SUCCESS:
         self.response.set_status(200,'OK')
         table = SaveTable()
         table.Username = username
         table.Password = password
         table.put()
     else:
         self.response.set_status(403,'Forbidden')
     self.response.write(json.dumps({'result':status}))
Exemple #2
0
 def post(self):
     self.setCorsHeader()
     username = self.request.get('username')
     password = self.request.get('password')
     status = self.isParamaterLegal(username, password)
     if status == self.SUCCESS:
         self.response.set_status(200, 'OK')
         table = SaveTable()
         table.Username = username
         table.Password = password
         table.put()
     else:
         self.response.set_status(403, 'Forbidden')
     self.response.write(json.dumps({'result': status}))
 def getUser(self, username ,password):
     user = SaveTable.query(SaveTable.Username == username).get()
     if user:
         if user.Password == password:
             return user
     return None
 def isUsernameExist(self, username):
     if SaveTable.query(SaveTable.Username == username).get():
         return True
     else:
         return False