Ejemplo n.º 1
0
	def check(self, username, email, password):
		# not null check
		if not username :
			result = {"errno" : -1, "err" : "用户名为空"}
			return result
		if not email :
			result = {"errno" : -1, "err" : "邮箱为空"}
			return result
		if not password :
			result = {"errno" : -1, "err" : "密码为空"}
			return result

		bl = AutoUser.checkUsername(username)
		if bl :
			result = {"errno" : -1, "err" : "用户名已被注册"}
			return result

		bl = self.validateEmail(email)

		if not bl:
			result = {"errno" : -1, "err" : "邮箱格式不正确"}
			return result

		bl = AutoUser.checkEmail(email)
		if bl :
			result = {"errno" : -1, "err" : "邮箱已被注册"}
			return result

		result = {"errno" : 1, "err" : "注册成功"}
		return result
Ejemplo n.º 2
0
	def post(self):
		user_name = self.get_argument("username")
		bl = AutoUser.checkUsername(user_name)

		if bl :
			result = {"errno" : -1, "err" : "用户名已被注册"}
		else :
			result = {"errno" : 1, "err" : ""}

		self.write(result)
Ejemplo n.º 3
0
	def post(self):
		user_name = self.get_argument("username")
		bl = AutoUser.checkUsername(user_name)
		# 
		print 'username: '******'sessionId : ' , self.get_session_id()

		if bl :
			result = "false"
		else :
			result = "true"

		self.write(result)