From 2f32b71b2b330870b89a191431e88dc622bbba11 Mon Sep 17 00:00:00 2001 From: nineven Date: Mon, 24 Jan 2022 20:16:23 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=B8=8B=E8=BD=BD=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fir_client/src/components/FirDownload.vue | 31 +++++++++++--------- fir_client/src/components/ShortDownload.vue | 32 ++++++++++++--------- fir_ser/api/views/domain.py | 9 +++--- 3 files changed, 40 insertions(+), 32 deletions(-) diff --git a/fir_client/src/components/FirDownload.vue b/fir_client/src/components/FirDownload.vue index 0464f8a..4772516 100644 --- a/fir_client/src/components/FirDownload.vue +++ b/fir_client/src/components/FirDownload.vue @@ -311,11 +311,13 @@ -
- - {{ this.currentappinfo.name | formatName }} - -
+ +
+ +
+ {{ this.currentappinfo.name }} +
+
@@ -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) { diff --git a/fir_client/src/components/ShortDownload.vue b/fir_client/src/components/ShortDownload.vue index 5552d30..8f2787c 100644 --- a/fir_client/src/components/ShortDownload.vue +++ b/fir_client/src/components/ShortDownload.vue @@ -315,12 +315,14 @@
-
- - {{ this.currentappinfo.name | formatName }} - -
+
+
+ +
+ {{ this.currentappinfo.name }} +
+

{{ error_msg.head }}

@@ -328,6 +330,7 @@
+ @@ -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) { diff --git a/fir_ser/api/views/domain.py b/fir_ser/api/views/domain.py index 56be5be..2d88117 100644 --- a/fir_ser/api/views/domain.py +++ b/fir_ser/api/views/domain.py @@ -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)