super_signature
nineven 5 years ago
parent 96cd18e405
commit a341fbc647
  1. 6
      fir_client/src/components/FirSuperSignBase.vue
  2. 18
      fir_ser/api/utils/app/supersignutils.py
  3. 6
      fir_ser/api/views/supersign.py

@ -21,7 +21,8 @@
<el-input v-model="editdeveloperinfo.description"></el-input>
</el-form-item>
<div style="" >
<el-button v-if="isedit" @click="syncdevices">同步设备信息</el-button>
<el-button v-if="isedit && editdeveloperinfo.is_actived" @click="syncdevices">同步设备信息</el-button>
<el-button v-if="isedit && editdeveloperinfo.is_actived && !editdeveloperinfo.certid" @click="isocertcert">手动创建证书</el-button>
<el-button @click="updateorcreate">保存</el-button>
<el-button @click="canceledit">取消</el-button>
</div>
@ -367,6 +368,9 @@
syncdevices(){
this.iosdeveloperFun({"methods":"PUT","data":{"email":this.editdeveloperinfo.email,"act":"syncdevice"}});
},
isocertcert(){
this.iosdeveloperFun({"methods":"PUT","data":{"email":this.editdeveloperinfo.email,"act":"ioscert"}});
},
inputcode(developer){
this.$prompt('请输入验证码', '提示', {
confirmButtonText: '确定',

@ -331,7 +331,7 @@ class IosUtils(object):
app_api_obj2.del_app(app_obj.bundle_id,app_obj.app_id)
@staticmethod
def clean_developer(developer_obj):
def clean_developer(developer_obj,user_obj):
'''
根据消耗记录 删除该苹果账户下所有信息
:param developer_obj:
@ -342,6 +342,20 @@ class IosUtils(object):
IosUtils.clean_app_by_developer_obj(app_obj, developer_obj)
delete_app_to_dev_and_file(developer_obj,app_obj.id)
IosUtils.clean_udid_by_app_obj(app_obj, developer_obj)
auth = {
"username": developer_obj.email
}
full_path=file_format_path(user_obj, auth)
try:
for root, dirs, files in os.walk(full_path, topdown=False):
for name in files:
os.remove(os.path.join(root, name))
for name in dirs:
os.rmdir(os.path.join(root, name))
os.rmdir(full_path)
except Exception as e:
print(e)
@staticmethod
def active_developer(developer_obj,code=None):
@ -424,7 +438,7 @@ def file_format_path(user_obj,auth):
def delete_app_to_dev_and_file(developer_obj,app_id):
APPToDeveloper_obj=APPToDeveloper.objects.filter(developerid=developer_obj, app_id_id=app_id)
if APPToDeveloper_obj:
binary_file = os.path.join(MEDIA_ROOT, APPToDeveloper_obj.first().binary_file + ".ipa")
binary_file = APPToDeveloper_obj.first().binary_file + ".ipa"
lsobj=LocalStorage("localhost",False)
lsobj.del_file(binary_file)
APPToDeveloper_obj.delete()

@ -72,6 +72,10 @@ class DeveloperView(APIView):
else:
IosUtils.create_developer_cert(developer_obj,request.user)
IosUtils.get_device_from_developer(developer_obj, request.user)
elif act == "ioscert":
if not developer_obj.certid:
IosUtils.create_developer_cert(developer_obj, request.user)
IosUtils.get_device_from_developer(developer_obj, request.user)
elif act == "syncdevice":
IosUtils.get_device_from_developer(developer_obj,request.user)
@ -115,7 +119,7 @@ class DeveloperView(APIView):
if email:
developer_obj = AppIOSDeveloperInfo.objects.filter(user_id=request.user,email=email).first()
if developer_obj:
IosUtils.clean_developer(developer_obj)
IosUtils.clean_developer(developer_obj,request.user)
developer_obj.delete()
return self.get(request)

Loading…
Cancel
Save