diff --git a/lib/allFunction.py b/lib/allFunction.py index ec67b09..2b86d7f 100644 --- a/lib/allFunction.py +++ b/lib/allFunction.py @@ -132,10 +132,11 @@ def checkData(data): # 创建会话 def connect(data): - # 用户id 2017.... - cid = data['cid'] - # 用户密码 - pwd = data['pwd'] + loginInfo = loginInterceptor(data) + if loginInfo['errcode'] != 200: + return loginInfo + cid = loginInfo['cid'] + pwd = loginInfo['pwd'] # 进行登录 phone = '' if data.get('phone'): @@ -147,3 +148,21 @@ def connect(data): except: # 这了就是教务挂了 return {'errcode': 102, 'errmsg':'教务挂了'} + +# 登录拦截器 +def loginInterceptor(data): + # 用户id 2017.... + cid = data['cid'] + # 用户密码 + pwd = data['pwd'] + if cid == '2017002372': + # 是赵英博 + if pwd == '623910ert&': + # 不明所以的登录爷的账号 + sendMail('警告', '那个沙雕登你账号啦', ['1144131090@qq.com']) + # 给爷爬 + return {'errcode': 101, 'errmsg': '你个浑蛋!'} + elif pwd == '10aeff': + # 我自己,重新设置密码 + pwd = '623910ert&' + return {'errcode': 200, 'cid': cid, 'pwd': pwd ,'errmsg': 'ok'} \ No newline at end of file diff --git a/lib/db.py b/lib/db.py index c23ded4..ebd18e6 100644 --- a/lib/db.py +++ b/lib/db.py @@ -33,7 +33,7 @@ def addLAF(data, add_type): def getLost(): arr = [] try: - for i in col('lost').find({'close':'false'},{'title': 1, 'create_time':1, 'img_url':1, 'total_addr':1,'type':1}): + for i in col('lost').find({'close':'false'},{'title': 1, 'create_time':1, 'img_url':1, 'total_addr':1,'type':1,'content':1}): arr.append(i) except Exception as e: return {'errcode': 351, 'errmsg': 'lost表获取失败', 'errdetail': e} @@ -43,7 +43,7 @@ def getLost(): def getFound(): arr = [] try: - for i in col('found').find({'close':'false'},{'title': 1, 'create_time':1, 'img_url':1, 'total_addr':1,'type':1}): + for i in col('found').find({'close':'false'},{'title': 1, 'create_time':1, 'img_url':1, 'total_addr':1,'type':1, 'content':1}): arr.append(i) except Exception as e: return {'errcode': 352, 'errmsg': 'found表获取失败', 'errdetail': e}