add loginInterceptor

This commit is contained in:
RainSun 2020-02-16 18:48:00 +08:00
parent a1f73370d2
commit 320117c904

View File

@ -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']
# 进行登录
try:
# 这里教务没问题账户没问题就是200密码错了就是101
@ -144,3 +145,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'}