优化代码

publicsignpoll
youngS 3 years ago
parent 2ee4352544
commit 1cc05645ec
  1. 38
      fir_ser/api/migrations/0020_auto_20211104_1118.py
  2. 7
      fir_ser/api/utils/baseutils.py
  3. 1
      fir_ser/api/utils/crontab/ctasks.py

@ -0,0 +1,38 @@
# Generated by Django 3.2.3 on 2021-11-04 11:18
from django.db import migrations, models
import api.utils.daobase
class Migration(migrations.Migration):
dependencies = [
('api', '0019_iosdeveloperpublicpoolbill_udid'),
]
operations = [
migrations.RemoveField(
model_name='iosdeveloperpublicpoolbill',
name='udid_info',
),
migrations.AddField(
model_name='iosdeveloperpublicpoolbill',
name='product',
field=models.CharField(blank=True, max_length=64, null=True, verbose_name='设备udid'),
),
migrations.AddField(
model_name='iosdeveloperpublicpoolbill',
name='version',
field=models.CharField(blank=True, max_length=64, null=True, verbose_name='设备udid'),
),
migrations.AlterField(
model_name='appiosdeveloperinfo',
name='p8key',
field=api.utils.daobase.AESCharField(max_length=512, verbose_name='p8key'),
),
migrations.AlterField(
model_name='appstorage',
name='secret_key',
field=api.utils.daobase.AESCharField(blank=True, max_length=128, null=True, verbose_name='存储访问secret'),
),
]

@ -40,7 +40,7 @@ class AESCipher(object):
enc = base64.b64decode(enc) enc = base64.b64decode(enc)
iv = enc[:AES.block_size] iv = enc[:AES.block_size]
cipher = AES.new(self.key, AES.MODE_CBC, iv) cipher = AES.new(self.key, AES.MODE_CBC, iv)
return self._unpack_data(cipher.decrypt(enc[AES.block_size:])).decode('utf-8') return self._unpack_data(cipher.decrypt(enc[AES.block_size:]))
@staticmethod @staticmethod
def _pack_data(s): def _pack_data(s):
@ -49,7 +49,10 @@ class AESCipher(object):
@staticmethod @staticmethod
def _unpack_data(s): def _unpack_data(s):
return s[:-ord(s[len(s) - 1:])] data = s[:-ord(s[len(s) - 1:])]
if isinstance(data, bytes):
data = data.decode('utf-8')
return data
def make_from_user_uuid(userinfo): def make_from_user_uuid(userinfo):

@ -74,6 +74,7 @@ def auto_check_ios_developer_active():
status, result = IosUtils.active_developer(ios_developer) status, result = IosUtils.active_developer(ios_developer)
msg = f"auto_check_ios_developer_active user:{userinfo} ios.developer:{ios_developer} status:{status} result:{result}" msg = f"auto_check_ios_developer_active user:{userinfo} ios.developer:{ios_developer} status:{status} result:{result}"
if status: if status:
IosUtils.get_device_from_developer(ios_developer)
logger.info(msg) logger.info(msg)
break break
else: else:

Loading…
Cancel
Save