Exemplo n.º 1
0
	def POST(self):
		#需要接收account_id
		if session.login == 1:
			if session.user:
				account_id = web.input().account_id
				account_name = web.input().account_name
				account_username = web.input().account_username
				account_work = web.input().account_work
				account_email = web.input().account_email
				account_phone = web.input().account_phone
				account_position = web.input().account_position
				account_department = web.input().account_department
				account_power1 = web.input().account_power1
				account_power2 = web.input().account_power2
				account_power3 = web.input().account_power3
				account_power4 = web.input().account_power4
				account_power = int(account_power1)*1000+int(account_power2)*100+int(account_power3)*10+int(account_power4)
				#检查输入信息
				result = account.account_check(account_name, account_username, account_work, account_email, account_phone,account_position,account_department, account_power)

				if result == "no error":
					#存储任务信息
					account.account_update(account_id, account_name, account_username, account_work, account_email, account_phone, account_position, account_department, account_power)
					account_list = account.account_list('*')
					ajax_result = {"statusCode":"200", "message":"账号修改成功", "callbackType":"closeCurrent"}
					return json.dumps(ajax_result)
			else:
				return json.dumps({"statusCode":"301", "message":"会话超时,请重新登录"})
		else:
			return json.dumps({"statusCode":"301", "message":"会话超时,请重新登录"})
Exemplo n.º 2
0
Arquivo: index.py Projeto: haohy/TDOA
	def POST(self):
		#添加新用户
		if session.login == 1:
			if session.user:
				account_name = web.input().account_name
				account_sex = web.input().account_sex
				account_username = web.input().account_username
				account_work = web.input().account_work
				account_position = web.input().account_position
				account_phone = web.input().account_phone
				account_address = web.input().account_address
				account_email = web.input().account_email
				account_department = web.input().account_department
				account_power1 = web.input().account_power1
				account_power2 = web.input().account_power2
				account_power3 = web.input().account_power3
				account_power4 = web.input().account_power4
				account_power = int(account_power1)*1000+int(account_power2)*100+int(account_power3)*10+int(account_power4)
				#检查账号信息是否合法
				result = account.account_check(account_name, account_sex, account_username, account_work, account_position, account_phone,account_address,account_email,account_department, account_power)
				ajax_result = {"statusCode":"300", "message":result}
				web.header('Content-Type', 'application/json')
				if result == "no error":
					#将用户信息存储到数据库中
					account.account_save(account_name, account_sex, account_username, account_work, account_position, account_phone,account_address,account_email,account_department, account_power)
					#这里account_list是干啥的?
					account_list = account.account_list(account_department = '*')
					ajax_result = {"statusCode":"200", "message":"账号添加成功", "callbackType":"closeCurrent"}
					return json.dumps(ajax_result)
			else:
				return json.dumps({"statusCode":"301", "message":"会话超时,请重新登录"})
		else:
			return json.dumps({"statusCode":"301", "message":"会话超时,请重新登录"})
Exemplo n.º 3
0
	def POST(self):
		#登录控制
		if session.login == 1:
			if session.user:
				account_name = web.input().account_name
				account_username = web.input().account_username
				account_work = web.input().account_work
				account_email = web.input().account_email
				account_phone = web.input().account_phone
				account_position = web.input().account_position
				account_department = web.input().account_department
				account_power1 = web.input().account_power1
				account_power2 = web.input().account_power2
				account_power3 = web.input().account_power3
				account_power4 = web.input().account_power4
				account_power = int(account_power1)*1000+int(account_power2)*100+int(account_power3)*10+int(account_power4)
				#检查账号信息是否合法
				result = account.account_check(account_name, account_username, account_work, account_email, account_phone,account_position,account_department, account_power)
				ajax_result = {"statusCode":"300", "message":result}
				web.header('Content-Type', 'application/json')
				if result == "no error":
					account.account_save(account_name,account_username, account_work, account_email, account_phone, account_position, account_department, account_power)
					account_list = account.account_list(account_department = '*')
					ajax_result = {"statusCode":"200", "message":"账号添加成功", "callbackType":"closeCurrent"}
					return json.dumps(ajax_result)
			else:
				return json.dumps({"statusCode":"301", "message":"会话超时,请重新登录"})
		else:
			return json.dumps({"statusCode":"301", "message":"会话超时,请重新登录"})
Exemplo n.º 4
0
Arquivo: index.py Projeto: haohy/TDOA
	def POST(self):
		#需要接收account_id
		if session.login == 1:
			if session.user:
				account_id = web.input().account_id
				account_sex = web.input().account_sex
				account_name = web.input().account_name
				account_username = web.input().account_username
				account_work = web.input().account_work
				account_email = web.input().account_email
				account_phone = web.input().account_phone
				account_position = web.input().account_position
				account_address = web.input().account_address
				account_department = web.input().account_department
				account_power1 = web.input().account_power1
				account_power2 = web.input().account_power2
				account_power3 = web.input().account_power3
				account_power4 = web.input().account_power4
				account_power = int(account_power1)*1000+int(account_power2)*100+int(account_power3)*10+int(account_power4)
				#检查输入信息
				result = account.account_check(account_name, account_sex, account_username, account_work,account_position,account_phone, account_address, account_email, account_department, account_power)
				if result == "no error":
					#存储任务信息
					account.account_update(account_name, account_sex, account_username, account_work,account_position,account_phone, account_address, account_email, account_department, account_power,account_id)
					account_list = account.account_list('*')
					ajax_result = {"statusCode":"200", "message":"账号修改成功", "callbackType":"closeCurrent"}
					return json.dumps(ajax_result)
			else:
				return json.dumps({"statusCode":"301", "message":"会话超时,请重新登录"})
		else:
			return json.dumps({"statusCode":"301", "message":"会话超时,请重新登录"})