优化下载页

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

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

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

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

Loading…
Cancel
Save