优化下载页

dependabot/npm_and_yarn/fir_admin/url-parse-1.5.10
nineven 3 years ago
parent 03a6202ee2
commit 2f32b71b2b
  1. 31
      fir_client/src/components/FirDownload.vue
  2. 32
      fir_client/src/components/ShortDownload.vue
  3. 9
      fir_ser/api/views/domain.py

@ -311,11 +311,13 @@
</el-container>
<div v-else>
<i v-if="!report_flag">
{{ this.currentappinfo.name | formatName }}
</i>
</div>
<el-container v-else style="margin-top:46%">
<div v-if="!report_flag" style="text-align: center;margin:0 auto">
<span id="qrcode1" style="display: inline-block"></span>
<br/>
{{ this.currentappinfo.name }}
</div>
</el-container>
<div ref="signhelp" class="signhelp screenshots-section">
@ -685,16 +687,22 @@ export default {
})
}
},
qrcode() {
let qrcode = document.getElementById("qrcode");
make_qr(qrcode, x) {
if (qrcode) {
new QRCode(qrcode, {
width: 100,
height: 100,
width: x,
height: x,
text: location.href, //
})
}
},
qrcode() {
this.make_qr(document.getElementById("qrcode"), 100)
// eslint-disable-next-line no-unused-vars
setTimeout(_ => {
this.make_qr(document.getElementById("qrcode1"), 266)
}, 1000);
},
getDownloadTokenFun() {
let params = {
"short": this.$route.params.short,
@ -899,11 +907,6 @@ export default {
this.check_msg();
}
}, filters: {
formatName: function (name) {
if (name) {
return name.replace("麻将", "").replace("斗地主", "").replace("棋牌", "")
}
},
getiOStype: function (type) {
let ftype = '';
if (type === 1) {

@ -315,12 +315,14 @@
</div>
<div v-else>
<i v-if="!report_flag">
{{ this.currentappinfo.name | formatName }}
</i>
</div>
<div v-else style="margin-top:46%;text-align:center">
<div v-if="!report_flag && !iserror" style="margin:0 auto;z-index: 10">
<span id="qrcode1" style="display: inline-block"></span>
<br/>
{{ this.currentappinfo.name }}
</div>
</div>
<div v-if='iserror' class="main">
<div class="error-container">
<h1>{{ error_msg.head }}</h1>
@ -328,6 +330,7 @@
</header>
</div>
</div>
</div>
@ -646,16 +649,22 @@ export default {
})
}
},
qrcode() {
let qrcode = document.getElementById("qrcode");
make_qr(qrcode, x) {
if (qrcode) {
new QRCode(qrcode, {
width: 100,
height: 100,
width: x,
height: x,
text: location.href, //
})
}
},
qrcode() {
this.make_qr(document.getElementById("qrcode"), 100)
// eslint-disable-next-line no-unused-vars
setTimeout(_ => {
this.make_qr(document.getElementById("qrcode1"), 266)
}, 1000);
},
getDownloadTokenFun() {
let params = {
"short": this.$route.params.short,
@ -859,11 +868,6 @@ export default {
this.check_msg();
}
}, filters: {
formatName: function (name) {
if (name) {
return name.replace("麻将", "").replace("斗地主", "").replace("棋牌", "")
}
},
getiOStype: function (type) {
let ftype = '';
if (type === 1) {

@ -34,10 +34,12 @@ def get_domain_filter(request):
return filter_dict
def auto_clean_download_cache(user_obj, user_domain_obj, app_obj):
def auto_clean_download_cache(user_obj, user_domain_obj, app_obj, delete=False):
if user_domain_obj:
base_domain_queryset = UserDomainInfo.objects.filter(user_id=user_obj, is_enable=True).all()
if user_domain_obj.domain_type in [0, 1]:
if delete:
user_domain_obj.delete()
if base_domain_queryset.filter(domain_type__in=[0, 1]).count() == 0:
reset_app_wx_easy_type(user_obj, None)
else:
@ -158,7 +160,7 @@ class DomainCnameView(APIView):
user_obj = user_domain_obj_list.first().user_id
app_obj = user_domain_obj_list.first().app_id
o_user_domain_obj = user_domain_obj_list.first()
auto_clean_download_cache(user_obj, o_user_domain_obj, app_obj)
auto_clean_download_cache(user_obj, o_user_domain_obj, app_obj, True)
user_domain_obj_list.delete()
if kwargs.get('domain_type', -1) in [0, 2]:
@ -192,8 +194,7 @@ class DomainCnameView(APIView):
app_obj = None
if app_id:
app_obj = Apps.objects.filter(app_id=app_id).first()
auto_clean_download_cache(request.user, user_domain_obj, app_obj)
user_domain_obj.delete()
auto_clean_download_cache(request.user, user_domain_obj, app_obj, True)
return Response(res.dict)

Loading…
Cancel
Save