优化代码

dependabot/npm_and_yarn/fir_admin/dns-packet-1.3.4
youngS 4 years ago
parent fd56fcd88b
commit 8b0fab87b5
  1. 54
      fir_ser/api/utils/app/shellcmds.py
  2. 5
      fir_ser/api/utils/pay/ali.py
  3. 0
      fir_ser/api/utils/pay/alipay/__init__.py
  4. 0
      fir_ser/api/utils/pay/alipay/compat.py
  5. 0
      fir_ser/api/utils/pay/alipay/exceptions.py
  6. 0
      fir_ser/api/utils/pay/alipay/loggers.py
  7. 0
      fir_ser/api/utils/pay/alipay/utils.py
  8. 2
      fir_ser/api/utils/pay/wx.py
  9. 0
      fir_ser/api/utils/pay/wxpay/__init__.py
  10. 0
      fir_ser/api/utils/pay/wxpay/core.py
  11. 12
      fir_ser/api/utils/storage/caches.py

@ -9,9 +9,6 @@ import logging
import paramiko, json import paramiko, json
import socket import socket
# import pexpect
# from api.utils.storage.caches import developer_auth_code
logger = logging.getLogger(__file__) logger = logging.getLogger(__file__)
@ -89,57 +86,6 @@ class SSHConnection(object):
self._client.close() self._client.close()
# def pshell_command(cmdstrs, user_obj, developer_email, timeout=60 * 10):
# result = default_result()
# run = pexpect.spawn(cmdstrs, encoding='utf-8')
# try:
# index = run.expect(
# ["Two-factor Authentication", "Invalid username and password combination", pexpect.EOF, pexpect.TIMEOUT],
# timeout=timeout)
# if index == 0:
# count = 1
# if timeout == -1:
# timeout = 60 * 60 * 24
# while True and count < timeout / 3:
# code = developer_auth_code("get", user_obj, developer_email)
# if code:
# run.sendline(code)
# try:
# err = run.expect(["Unauthorized Access", pexpect.EOF, pexpect.TIMEOUT])
# if err == 0:
# result['exit_code'] = 2
# result['return_info'] = 'Unauthorized Access 【验证码有误】'
# elif err == 1:
# result['exit_code'] = 0
# result['return_info'] = 'Verify Code Success'
# else:
# result['exit_code'] = 3
# result['return_info'] = 'Verify Code TimeOut or UnKnown Error 【双重验证未知错误】'
# developer_auth_code("del", user_obj, developer_email)
# return result
# except Exception as e:
# logger.error("cmdstrs:%s developer_email:%s user_obj:%s Exception:%s" % (
# cmdstrs, developer_email, user_obj, e))
# developer_auth_code("del", user_obj, developer_email)
# result['exit_code'] = 0
# result['return_info'] = 'Success'
# return result
# count += 1
# time.sleep(3)
# elif index == 1:
# result['exit_code'] = 1
# result['return_info'] = 'Invalid username and password combination 【密码或者账号有误】'
# elif index == 2:
# result['exit_code'] = 0
# result['return_info'] = 'Alreay Success'
# else:
# result['exit_code'] = 4
# result['return_info'] = 'Code TimeOut or UnKnown Error 【验证超时】'
# except Exception as e:
# logger.error("cmdstrs:%s developer_email:%s user_obj:%s Exception:%s" % (cmdstrs, developer_email, user_obj, e))
# return result
def shell_command(cmdstrs, timeout): def shell_command(cmdstrs, timeout):
result = default_result() result = default_result()
result['return_info'] = '' result['return_info'] = ''

@ -6,9 +6,8 @@
# pip install alipay-sdk-python==3.3.398 # pip install alipay-sdk-python==3.3.398
from api.utils.alipay import AliPay from api.utils.pay.alipay import AliPay
from api.utils.alipay.utils import AliPayConfig from api.utils.pay.alipay.utils import AliPayConfig
from fir_ser.settings import PAY_CONFIG
from datetime import datetime, timedelta from datetime import datetime, timedelta
from api.utils.storage.caches import update_order_info, update_order_status from api.utils.storage.caches import update_order_info, update_order_status
import json import json

@ -4,7 +4,7 @@
# author: NinEveN # author: NinEveN
# date: 2021/3/18 # date: 2021/3/18
from api.utils.wxpay import WeChatPay, WeChatPayType from api.utils.pay.wxpay import WeChatPay, WeChatPayType
from datetime import datetime, timedelta from datetime import datetime, timedelta
from api.utils.storage.caches import update_order_info, update_order_status from api.utils.storage.caches import update_order_info, update_order_status
import json import json

@ -229,18 +229,6 @@ def get_app_today_download_times(app_ids):
return download_times_count return download_times_count
# def developer_auth_code(act, user_obj, developer_issuer_id, code=None):
# auth_key = file_format_path(user_obj, email=developer_issuer_id)
# key = "_".join([CACHE_KEY_TEMPLATE.get("developer_auth_code_key"), auth_key])
# if act == "set":
# cache.delete(key)
# cache.set(key, code, 60 * 10)
# elif act == "get":
# return cache.get(key)
# elif act == "del":
# cache.delete(key)
def upload_file_tmp_name(act, filename, user_obj_id): def upload_file_tmp_name(act, filename, user_obj_id):
tmp_key = "_".join([CACHE_KEY_TEMPLATE.get("upload_file_tmp_name_key"), filename]) tmp_key = "_".join([CACHE_KEY_TEMPLATE.get("upload_file_tmp_name_key"), filename])
if act == "set": if act == "set":

Loading…
Cancel
Save