本文整理匯總了Python中dao.UserDao.get_user_by_email方法的典型用法代碼示例。如果您正苦於以下問題:Python UserDao.get_user_by_email方法的具體用法?Python UserDao.get_user_by_email怎麽用?Python UserDao.get_user_by_email使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類dao.UserDao
的用法示例。
在下文中一共展示了UserDao.get_user_by_email方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: post
# 需要導入模塊: from dao import UserDao [as 別名]
# 或者: from dao.UserDao import get_user_by_email [as 別名]
def post(self):
'''登陸請求
paras:
* email_or_phone 用戶可以輸入手機號或者郵箱來進行登陸
* pwd 登陸密碼
* remember_me 是否記住登陸狀態(TODO)
response:
'''
email_or_phone = self.get_argument('email_or_phone')
pwd = self.get_argument('pwd')
remember_me = self.get_argument('remember_me',default='off')
enroll_type = StringUtil.is_email_or_phone(email_or_phone)
if enroll_type == 'neither':
#如果用戶輸入不是郵箱或者電話號,則登陸失敗
self.write(RESPONSE.WRONG_TYPE)
return
user = UserDao.get_user_by_email(email_or_phone) if enroll_type == 'email' else UserDao.get_user_by_phone(email_or_phone)
if not user:
#如果取不到用戶,則登陸失敗
self.write(RESPONSE.WRONG_TYPE)
elif hashlib.md5(pwd).hexdigest() != user['pwd']:
#如果密碼錯誤,則登陸失敗
self.write(RESPONSE.INVALID_PASSWORD)
else:
self.set_secure_cookie("tid",str(user['tid']))
self.set_secure_cookie("timestamp", str(time.time()))
self.write(RESPONSE.SUCCESS)
示例2: test_enroll
# 需要導入模塊: from dao import UserDao [as 別名]
# 或者: from dao.UserDao import get_user_by_email [as 別名]
def test_enroll():
user = UserDao.get_user_by_email(email)
device = user['device']
active_code = ""
for d in device:
if d['uid'] == uid:
active_code = d['active_code']
tid = user['tid']
result = DeviceDao.enroll(uid,active_code,tid)
assert result['status'] == 1
示例3: test_register_list
# 需要導入模塊: from dao import UserDao [as 別名]
# 或者: from dao.UserDao import get_user_by_email [as 別名]
def test_register_list():
user = UserDao.get_user_by_email(email)
list1 = DeviceDao.register_list(user)
assert list1 != []
示例4: test_exist
# 需要導入模塊: from dao import UserDao [as 別名]
# 或者: from dao.UserDao import get_user_by_email [as 別名]
def test_exist():
user = UserDao.get_user_by_email(email)
device = DeviceDao.exist(uid,owner,user)
assert device == True
示例5: test_add
# 需要導入模塊: from dao import UserDao [as 別名]
# 或者: from dao.UserDao import get_user_by_email [as 別名]
def test_add():
user = UserDao.get_user_by_email(email)
result = DeviceDao.add(uid,owner,user)
assert result == 'success'
示例6: test_get_user_by_token
# 需要導入模塊: from dao import UserDao [as 別名]
# 或者: from dao.UserDao import get_user_by_email [as 別名]
def test_get_user_by_token():
user = UserDao.get_user_by_email(email)
user2 = UserDao.get_user_by_token(user['token'])
assert user2['email'] == email
示例7: test_get_user_by_tid
# 需要導入模塊: from dao import UserDao [as 別名]
# 或者: from dao.UserDao import get_user_by_email [as 別名]
def test_get_user_by_tid():
user = UserDao.get_user_by_email(email)
user2 = UserDao.get_user_by_tid(user['tid'])
assert user2['email'] == email
示例8: test_get_user_by_email
# 需要導入模塊: from dao import UserDao [as 別名]
# 或者: from dao.UserDao import get_user_by_email [as 別名]
def test_get_user_by_email():
user = UserDao.get_user_by_email(email)
assert user['email'] == email
示例9: test_update_loc
# 需要導入模塊: from dao import UserDao [as 別名]
# 或者: from dao.UserDao import get_user_by_email [as 別名]
def test_update_loc():
user = UserDao.get_user_by_email(email)
result = LocDao.update(user['token'],did,loc_info)
assert result['status'] == 1
示例10: test_update_app
# 需要導入模塊: from dao import UserDao [as 別名]
# 或者: from dao.UserDao import get_user_by_email [as 別名]
def test_update_app():
user = UserDao.get_user_by_email(email)
result = AppDao.update(user['token'],did,apps)
assert result['status'] == 1
示例11: test_delete
# 需要導入模塊: from dao import UserDao [as 別名]
# 或者: from dao.UserDao import get_user_by_email [as 別名]
def test_delete():
user = UserDao.get_user_by_email(email)
result = BlackListDao.delete(user,did,appId_list)
assert result == 'success'
示例12: test_list
# 需要導入模塊: from dao import UserDao [as 別名]
# 或者: from dao.UserDao import get_user_by_email [as 別名]
def test_list():
user = UserDao.get_user_by_email(email)
result = BlackListDao.list(user['token'],did,user)
assert result['status'] == 1
示例13: test_insert
# 需要導入模塊: from dao import UserDao [as 別名]
# 或者: from dao.UserDao import get_user_by_email [as 別名]
def test_insert():
user = UserDao.get_user_by_email(email)
result = BlackListDao.app_insert(user,did,apps)
assert result == 'success'
示例14: test_config
# 需要導入模塊: from dao import UserDao [as 別名]
# 或者: from dao.UserDao import get_user_by_email [as 別名]
def test_config():
user = UserDao.get_user_by_email(email)
result = DeviceDao.config(user['token'],did)
assert result['status'] == 1
示例15: test_update_device
# 需要導入模塊: from dao import UserDao [as 別名]
# 或者: from dao.UserDao import get_user_by_email [as 別名]
def test_update_device():
user = UserDao.get_user_by_email(email)
result = DeviceDao.update(user['token'],uid,did,cid,imei)
assert result['status'] == 1