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

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

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

@ -641,6 +641,32 @@ class DeviceTransferBillView(APIView):
res.code = 1003
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):
res = BaseResponse()
uid = request.query_params.get("uid", None)

Loading…
Cancel
Save