修改登录验证码权限问题

pull/66/head
wenxianping 2018-12-25 11:47:20 +08:00
parent 19de91af55
commit 806be00d3d
5 changed files with 11 additions and 9 deletions

View File

@ -1,6 +1,6 @@
FROM python:2.7.15 FROM python:2.7.15
WORKDIR /usr/src/app WORKDIR /usr/src/app
COPY Docker . ADD . /usr/src/app
ENV DEBIAN_FRONTEND noninteractive ENV DEBIAN_FRONTEND noninteractive
ENV TZ Asia/Shanghai ENV TZ Asia/Shanghai

View File

@ -17,8 +17,8 @@
- 修改config/ticket_config.yaml文件按照提示更改自己想要的信息 - 修改config/ticket_config.yaml文件按照提示更改自己想要的信息
- 运行根目录run.py即可开始 - 运行根目录run.py即可开始
- 如果你的服务器安装了docker那么就可以docker启动 - 如果你的服务器安装了docker那么就可以docker启动
- 1、docker build -t dockerautosign . - 1、docker build -t dockerticket .
- 2、docker run dockerautosign python start.py & - 2、docker run dockerticket python run.py &
- 3、本来是可以直接Dockerfile启动的不知道为毛启动不了如果有大佬看到问题所在欢迎提出 - 3、本来是可以直接Dockerfile启动的不知道为毛启动不了如果有大佬看到问题所在欢迎提出
- 目录对应说明 - 目录对应说明

View File

@ -115,9 +115,10 @@ class GoLogin:
raise UserPasswordException(u"温馨提示: 用户名或者密码为空,请仔细检查") raise UserPasswordException(u"温馨提示: 用户名或者密码为空,请仔细检查")
login_num = 0 login_num = 0
while True: while True:
if not getPassCodeNewOrderAndLogin(session=self.session, imgType="login"): result = getPassCodeNewOrderAndLogin(session=self.session, imgType="login")
if not result:
continue continue
self.randCode = getRandCode(self.is_auto_code, self.auto_code_type) self.randCode = getRandCode(self.is_auto_code, self.auto_code_type, result)
login_num += 1 login_num += 1
self.auth() self.auth()
if self.codeCheck(): if self.codeCheck():

View File

@ -27,6 +27,6 @@ def getPassCodeNewOrderAndLogin(session, imgType):
else: else:
print(u"下载验证码成功") print(u"下载验证码成功")
open(img_path, 'wb').write(result) open(img_path, 'wb').write(result)
return True return result
except OSError: except OSError:
print (u"验证码下载失败可能ip被封确认请手动请求: {0}".format(codeImgUrl)) print (u"验证码下载失败可能ip被封确认请手动请求: {0}".format(codeImgUrl))

View File

@ -5,7 +5,7 @@ from config.ticketConf import _get_yaml
from damatuCode.ruokuai import RClient from damatuCode.ruokuai import RClient
def getRandCode(is_auto_code, auto_code_type): def getRandCode(is_auto_code, auto_code_type, result):
""" """
识别验证码 识别验证码
:return: 坐标 :return: 坐标
@ -17,8 +17,9 @@ def getRandCode(is_auto_code, auto_code_type):
return return
if auto_code_type == 2: if auto_code_type == 2:
rc = RClient(_get_yaml()["auto_code_account"]["user"], _get_yaml()["auto_code_account"]["pwd"]) rc = RClient(_get_yaml()["auto_code_account"]["user"], _get_yaml()["auto_code_account"]["pwd"])
im = open('./tkcode', 'rb').read() print(result)
Result = rc.rk_create(im, 6113) # im = open('./tkcode', 'rb').read()
Result = rc.rk_create(result, 6113)
if "Result" in Result: if "Result" in Result:
return codexy(Ofset=",".join(list(Result["Result"])), is_raw_input=False) return codexy(Ofset=",".join(list(Result["Result"])), is_raw_input=False)
else: else: