Ejemplo n.º 1
0
 def get(self):
     result = UserOperate().get_user(self.ags['username'])
     if result is not None:
         username = AesUtil().decypt(self.ags['token']).replace(str(result['password']), '')
         if username == self.ags['username']:
             return {'status': True}
         return {'status': False}
     else:
         return {'status': False}
Ejemplo n.º 2
0
 def post(self):
     result = UserOperate().get_user(self.ags['username'])
     if result is not None and self.ags['password'] == str(
             result['password']):
         return {
             'login':
             True,
             'token':
             AesUtil().encypt(
                 str(result['user']) + str(result['password']))
         }, 200
     else:
         return {'login': False, 'token': None}, 200