当前位置: 首页>>代码示例>>Python>>正文


Python UserDao.get_user_by_email方法代码示例

本文整理汇总了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)
开发者ID:wh1100717,项目名称:poly_emm,代码行数:31,代码来源:UserController.py

示例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
开发者ID:wh1100717,项目名称:poly_emm,代码行数:13,代码来源:TestDao.py

示例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 != []
开发者ID:wh1100717,项目名称:poly_emm,代码行数:6,代码来源:TestDao.py

示例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
开发者ID:wh1100717,项目名称:poly_emm,代码行数:6,代码来源:TestDao.py

示例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'
开发者ID:wh1100717,项目名称:poly_emm,代码行数:6,代码来源:TestDao.py

示例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
开发者ID:wh1100717,项目名称:poly_emm,代码行数:6,代码来源:TestDao.py

示例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
开发者ID:wh1100717,项目名称:poly_emm,代码行数:6,代码来源:TestDao.py

示例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
开发者ID:wh1100717,项目名称:poly_emm,代码行数:5,代码来源:TestDao.py

示例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
开发者ID:wh1100717,项目名称:poly_emm,代码行数:6,代码来源:TestDao.py

示例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
开发者ID:wh1100717,项目名称:poly_emm,代码行数:6,代码来源:TestDao.py

示例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'
开发者ID:wh1100717,项目名称:poly_emm,代码行数:6,代码来源:TestDao.py

示例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
开发者ID:wh1100717,项目名称:poly_emm,代码行数:6,代码来源:TestDao.py

示例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'
开发者ID:wh1100717,项目名称:poly_emm,代码行数:6,代码来源:TestDao.py

示例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
开发者ID:wh1100717,项目名称:poly_emm,代码行数:6,代码来源:TestDao.py

示例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
开发者ID:wh1100717,项目名称:poly_emm,代码行数:6,代码来源:TestDao.py


注:本文中的dao.UserDao.get_user_by_email方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。