增加共享设备一键清理功能

xsign
MMXX 3 years ago
parent 7ceb9c83c1
commit 02f908e3de
  1. 34
      fir_client/src/components/user/FirSuperSignBase.vue
  2. 26
      fir_ser/xsign/views/supersign.py

@ -1169,15 +1169,21 @@
label="操作" label="操作"
width="100"> width="100">
<template slot-scope="scope"> <template slot-scope="scope">
<el-tooltip v-if="scope.row.cancel" content="点击撤回共享设备数,并清理目标用户签名脏数据" placement="top"> <div v-if="scope.row.cancel">
<el-tag v-if="scope.row.status===2" <el-tooltip v-if="scope.row.status===2" content="点击撤回共享设备数,并清理目标用户签名脏数据" placement="top">
type="success" <el-tag type="success" @click="cancelshare(scope.row)" >成功 </el-tag>
@click="cancelshare(scope.row)" </el-tooltip>
>成功 <el-tag v-else-if="scope.row.status === 1" type="info">已撤回</el-tag>
</el-tag>
<el-tag v-else-if="scope.row.status === 1">已撤回</el-tag>
<el-tag v-else>状态异常</el-tag> <el-tag v-else>状态异常</el-tag>
</div>
<div v-else>
<el-tooltip v-if="scope.row.status !== 1" content="清理所有签名数据" placement="top">
<el-tag @click="cleanshare(scope.row)" >清理
</el-tag>
</el-tooltip> </el-tooltip>
<el-tag v-else type="info">失效</el-tag>
</div>
</template> </template>
</el-table-column> </el-table-column>
@ -1391,9 +1397,15 @@ export default {
"page": this.pagination.currentPage "page": this.pagination.currentPage
}) })
}, },
cancelshare(billinfo) { cancelshare(billinfo){
this.cancelsharebase(billinfo,'确定要撤回么,撤回之后,对方账号将无法使用该账户设备数,并且会清理对方账户已经分配的设备数据信息?','DELETE')
},
cleanshare(billinfo){
this.cancelsharebase(billinfo,'确定要清理么,确定会清理该账户已经分配的设备数据信息?','PUT')
},
cancelsharebase(billinfo,msg,methods='DELETE') {
this.$confirm('确定要撤回么,撤回之后,对方账号将无法使用该账户设备数,并且会清理对方账户已经设备的设备数据信息?', '提示', { this.$confirm(msg, '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
@ -1410,10 +1422,10 @@ export default {
this.$message.success("操作成功") this.$message.success("操作成功")
this.refreshactiveFun() this.refreshactiveFun()
} else { } else {
this.$message.error("撤回失败 " + data.msg) this.$message.error("操作失败 " + data.msg)
} }
}, { }, {
'methods': 'DELETE', 'methods': methods,
data: {uid: billinfo.target_user.uid, status: billinfo.status, number: billinfo.number} data: {uid: billinfo.target_user.uid, status: billinfo.status, number: billinfo.number}
}) })
}).catch(() => { }).catch(() => {

@ -641,6 +641,32 @@ class DeviceTransferBillView(APIView):
res.code = 1003 res.code = 1003
return Response(res.dict) return Response(res.dict)
def put(self, request):
res = BaseResponse()
uid = request.data.get("uid", None)
status = request.data.get("status", None)
number = request.data.get("number", None)
if uid and status and number:
if check_uid_has_relevant(uid, request.user.uid):
if MigrateStorageState(uid).get_state():
res.code = 1008
res.msg = "数据迁移中,无法处理该操作"
return Response(res.dict)
bill_obj = IosDeveloperBill.objects.filter(user_id__uid=uid, to_user_id=request.user, status=status,
number=abs(int(number))).first()
if bill_obj:
for app_obj in Apps.objects.filter(user_id=request.user, type=1):
count = APPToDeveloper.objects.filter(app_id=app_obj).count()
if app_obj.issupersign or count > 0:
logger.info(f"app_id:{app_obj} is super_sign ,clean IOS developer")
IosUtils.clean_app_by_user_obj(app_obj)
return Response(res.dict)
res.code = 1003
res.msg = '转移记录不存在'
return Response(res.dict)
def delete(self, request): def delete(self, request):
res = BaseResponse() res = BaseResponse()
uid = request.query_params.get("uid", None) uid = request.query_params.get("uid", None)

Loading…
Cancel
Save