Commit 2a0d7404739b5e2d5222292baebfe2c5edefb68d

Authored by liujiqiang
1 parent 239bd679

更新

commons/api/doLogin.py
... ... @@ -12,12 +12,13 @@
12 12 import requests
13 13 import json
14 14 from commons.scripts.readConf import readConfig
  15 +from commons.scripts.pwdCry import pwdCry
15 16  
16 17 class doLogin():
17 18 def __init__(self):
18 19 rC = readConfig()
19 20 self.userName = rC.returnOptionsItems("loginInfo","userName")
20   - self.password = rC.returnOptionsItems("loginInfo","password")
  21 + self.password = pwdCry(rC.returnOptionsItems("loginInfo","password"))
21 22 self.loginUrl = rC.returnOptionsItems("host","uapHost")+"/api/authenticationApi/loginWeb"
22 23 self.loginData = {"userName":self.userName,"password":self.password}
23 24 self.webHeaders = {"X-Requested-With":"XMLHttpRequest",
... ...
commons/clientSession.py
... ... @@ -12,6 +12,7 @@
12 12 import requests
13 13 import json
14 14 from commons.scripts.readConf import readConfig
  15 +from commons.scripts.pwdCry import pwdCry
15 16  
16 17 class cliSession(object):
17 18 def __init__(self):
... ... @@ -20,7 +21,7 @@ class cliSession(object):
20 21 def __init__(self):
21 22 rC = readConfig()
22 23 self.userName = rC.returnOptionsItems("loginInfo","userName")
23   - self.password = rC.returnOptionsItems("loginInfo","password")
  24 + self.password = pwdCry(rC.returnOptionsItems("loginInfo","password"))
24 25 self.loginUrl = rC.returnOptionsItems("host","uapHost")+"/api/authenticationApi/loginWeb"
25 26 self.loginData = {"userName":self.userName,"password":self.password}
26 27 self.webHeaders = {"X-Requested-With":"XMLHttpRequest",
... ...
commons/scripts/pwdCry.py
... ... @@ -17,7 +17,6 @@ def pwdCry(string):
17 17 public_key = 'MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCgN7kda5L4ztOUquoHjubQIEyqBpjpaYeq+DBKXA3JNOZsMjGwLGVqfCwQg3HHAGTaWnxsp5gjmh0tSziJFgQf2u45TqA2UObOvklRhbWr56QoTNsjm72wZoSOlUzW3xHi/6PocHdy/7bMOiDf6fmYhFBZdRleX6tCAp7w6DsdbQIDAQAB'
18 18 key = '-----BEGIN PUBLIC KEY-----\n' + public_key + '\n-----END PUBLIC KEY-----'
19 19 rsakey = RSA.importKey(key)
20   - print(rsakey)
21 20 cipher = Cipher_pksc1_v1_5.new(rsakey)
22 21 encrypt_text = cipher.encrypt(string.encode("utf-8"))
23 22 cipher_text = base64.b64encode(encrypt_text)
... ...
config/marketConfig/test_config_hg
1 1 #沈阳市场信息
2 2 [loginInfo]
3 3 userName=scgy
4   -password=DYdgRcAyx2bPboAmu0tgIYBM1kMxFAuDty7IQk4162Zh+8KKa8jtu6xIjG9W4yauTfPiuP1sqxDatskXFqCOz76ea14AqRCYEBz53xVr+vLfcz9zOB2d1T3aIlJbEk8yi2c21pd/MFkBw+Fhd0tky/6eN8kJA8mtsj3uDwSb9qo=
  4 +password=123123
5 5  
6 6 [testInfo]
7 7 #已添加的身份证号
... ...
report/test.log
1   -[2021-07-20 13:19:50] [INFO] : 发送邮件
2   -[2021-07-20 13:19:53] [INFO] : 邮件发送完毕
  1 +[2021-07-20 13:56:07] [INFO] : 发送邮件
  2 +[2021-07-20 13:56:11] [INFO] : 邮件发送完毕
... ...