增加app 历史版本可查看更多

pull/18/head
youngS 4 years ago
parent 9727534b91
commit a57143f732
  1. BIN
      fir_client/src/assets/wx_pay.jpg
  2. 39
      fir_client/src/components/apps/FirAppInfostimeline.vue
  3. 1
      fir_client/src/restful/download.js
  4. 29
      fir_client/vue.config.js
  5. 1
      fir_ser/api/migrations/0045_auto_20210423_1645.py
  6. 1
      fir_ser/api/migrations/0046_auto_20210423_1650.py
  7. 70
      fir_ser/api/views/apps.py
  8. 1
      fir_ser/api/views/login.py
  9. 6
      fir_ser/fir_ser/settings.py

Binary file not shown.

Before

Width:  |  Height:  |  Size: 84 KiB

@ -1,7 +1,5 @@
<template>
<el-timeline>
<el-timeline-item v-for="(app) in release_apps" :key="app.release_id"
:timestamp="app.created_time|formatdatatimeline"
:color="app.master_color"
@ -96,11 +94,9 @@
</div>
</div>
</el-card>
</el-timeline-item>
<el-button v-if="has_next" class="time-line-more" @click="getapptimelineFun('more')">显示更多版本</el-button>
</el-timeline>
</template>
@ -117,9 +113,16 @@
editing: {'changelog': false, 'binary_url': false}
},
updatas: {},
query: {'page': 1, size: 10},
has_next: false,
}
},
methods: {
set_query_page() {
if (this.has_next) {
this.query.page += 1;
}
},
downloadPackage(app) {
getdownloadurl(res => {
if (res.code === 1000) {
@ -151,17 +154,24 @@
window.open(p_url, 'target', '');
},
getapptimelineFun() {
getapptimelineFun(act = '') {
const loading = this.$loading({
lock: true,
text: '加载中',
spinner: 'el-icon-loading',
// background: 'rgba(0, 0, 0, 0.7)'
});
if (act === 'more') {
this.set_query_page();
} else {
this.release_apps = [];
this.query = {'page': 1, size: 10};
}
releaseapputils(data => {
if (data.code === 1000) {
this.release_apps = data.data.release_apps;
this.currentapp = data.data.currentapp;
this.has_next = data.data.has_next;
this.release_apps = this.release_apps.concat(data.data.release_apps);
} else if (data.code === 1003) {
loading.close();
this.$router.push({name: 'FirApps'});
@ -171,6 +181,10 @@
"methods": "GET",
"app_id": this.$route.params.id,
"release_id": "timeline",
"data": {
"page": this.query.page,
"size": this.query.size
}
})
},
del_release_app(app) {
@ -313,7 +327,6 @@
position: relative;
padding-left: 80px;
color: #9b9b9b;
}
.directive-view-release > i {
@ -460,4 +473,14 @@
width: 500px
}
.time-line-more {
background: #F6F6F6;
border: 1px solid;
position: relative;
z-index: 99;
width: 160px;
padding: 10px 0;
border-radius: 40px;
margin-top: 10px;
}
</style>

@ -1,4 +1,5 @@
import Axios from 'axios'
Axios.defaults.withCredentials = true;
const DOMAIN = window.g.baseUrl;

@ -96,21 +96,9 @@ module.exports = {
'@': resolve('src')
}
},
plugins: [compress,new UglifyJsPlugin({
uglifyOptions: {
output: {
comments: false, // 去掉注释
},
warnings: false,
compress: {
drop_console: true,
drop_debugger: true,
pure_funcs: ['console.log']//移除console
}
}
})]
},
chainWebpack: config => {
if (page==='analyz') {
config
.plugin('webpack-bundle-analyzer')
@ -131,6 +119,21 @@ module.exports = {
})
}
if(IS_PROD){
config.plugins=[compress,new UglifyJsPlugin({
uglifyOptions: {
output: {
comments: false, // 去掉注释
},
warnings: false,
compress: {
drop_console: true,
drop_debugger: true,
pure_funcs: ['console.log']//移除console
}
}
})]
}
// config.plugins.delete('preload');

@ -4,7 +4,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('api', '0044_auto_20210422_1002'),
]

@ -4,7 +4,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('api', '0045_auto_20210423_1645'),
]

@ -24,11 +24,14 @@ from api.base_views import app_delete
logger = logging.getLogger(__name__)
def get_release_apps(res, app_serializer, apps_obj, storage):
res.data["currentapp"] = app_serializer.data
def get_release_apps(request, res, app_serializer, apps_obj, storage):
page_obj = AppsPageNumber()
app_release_obj = AppReleaseInfo.objects.filter(app_id=apps_obj).all().order_by("-created_time")
app_release_serializer = AppReleaseSerializer(app_release_obj, many=True,
app_release_page_serializer = page_obj.paginate_queryset(queryset=app_release_obj, request=request)
app_release_serializer = AppReleaseSerializer(app_release_page_serializer, many=True,
context={"storage": storage})
res.data['has_next'] = page_obj.page.has_next()
res.data["currentapp"] = app_serializer.data
res.data["release_apps"] = app_release_serializer.data
return res
@ -273,7 +276,7 @@ class AppReleaseinfoView(APIView):
if apps_obj:
storage = Storage(request.user)
app_serializer = AppsSerializer(apps_obj, context={"storage": storage})
res = get_release_apps(res, app_serializer, apps_obj, storage)
res = get_release_apps(request, res, app_serializer, apps_obj, storage)
else:
res.msg = "未找到该应用"
res.code = 1003
@ -297,34 +300,35 @@ class AppReleaseinfoView(APIView):
apprelease_count = AppReleaseInfo.objects.filter(app_id=apps_obj).values("release_id").count()
appreleaseobj = AppReleaseInfo.objects.filter(app_id=apps_obj, release_id=act).first()
if not appreleaseobj.is_master:
logger.info("delete app release %s" % (appreleaseobj))
storage.delete_file(appreleaseobj.release_id, appreleaseobj.release_type)
delete_local_files(appreleaseobj.release_id, appreleaseobj.release_type)
storage.delete_file(appreleaseobj.icon_url)
appreleaseobj.delete()
elif appreleaseobj.is_master and apprelease_count < 2:
logger.info("delete app master release %s and clean app %s " % (appreleaseobj, apps_obj))
count = APPToDeveloper.objects.filter(app_id=apps_obj).count()
if apps_obj.issupersign or count > 0:
logger.info("app_id:%s is supersign ,delete this app need clean IOS developer" % (app_id))
IosUtils.clean_app_by_user_obj(apps_obj, request.user)
storage.delete_file(appreleaseobj.release_id, appreleaseobj.release_type)
delete_local_files(appreleaseobj.release_id, appreleaseobj.release_type)
storage.delete_file(appreleaseobj.icon_url)
del_cache_by_delete_app(apps_obj.app_id)
appreleaseobj.delete()
delete_app_screenshots_files(storage, apps_obj)
has_combo = apps_obj.has_combo
if has_combo:
apps_obj.has_combo.has_combo = None
apps_obj.delete()
else:
pass
del_cache_response_by_short(apps_obj.app_id)
if appreleaseobj:
if not appreleaseobj.is_master:
logger.info("delete app release %s" % (appreleaseobj))
storage.delete_file(appreleaseobj.release_id, appreleaseobj.release_type)
delete_local_files(appreleaseobj.release_id, appreleaseobj.release_type)
storage.delete_file(appreleaseobj.icon_url)
appreleaseobj.delete()
elif appreleaseobj.is_master and apprelease_count < 2:
logger.info("delete app master release %s and clean app %s " % (appreleaseobj, apps_obj))
count = APPToDeveloper.objects.filter(app_id=apps_obj).count()
if apps_obj.issupersign or count > 0:
logger.info("app_id:%s is supersign ,delete this app need clean IOS developer" % (app_id))
IosUtils.clean_app_by_user_obj(apps_obj, request.user)
storage.delete_file(appreleaseobj.release_id, appreleaseobj.release_type)
delete_local_files(appreleaseobj.release_id, appreleaseobj.release_type)
storage.delete_file(appreleaseobj.icon_url)
del_cache_by_delete_app(apps_obj.app_id)
appreleaseobj.delete()
delete_app_screenshots_files(storage, apps_obj)
has_combo = apps_obj.has_combo
if has_combo:
apps_obj.has_combo.has_combo = None
apps_obj.delete()
else:
pass
del_cache_response_by_short(apps_obj.app_id)
return Response(res.dict)
@ -362,6 +366,6 @@ class AppReleaseinfoView(APIView):
del_cache_response_by_short(apps_obj.app_id)
app_serializer = AppsSerializer(apps_obj)
res = get_release_apps(res, app_serializer, apps_obj, Storage(request.user))
res = get_release_apps(request, res, app_serializer, apps_obj, Storage(request.user))
return Response(res.dict)

@ -665,6 +665,7 @@ class CertificationView(APIView):
class ChangeInfoView(APIView):
authentication_classes = [ExpiringTokenAuthentication, ]
def get(self, request):
response = BaseResponse()
response.data = {}

@ -306,9 +306,9 @@ THIRD_PART_CONFIG = {
'name': 'jiguang',
'type': 2,
'auth': {
'app_key': 'd039807b5f13386e0b303b91',
'master_secret': '11dbb341abc02888ba277d3a',
'sign_id': '10823',
'app_key': '93e1a9f71db4f044de4db34a',
'master_secret': '5f996ee39c7eb52906510cc2',
'sign_id': '18138',
'template_code': {
'login': '1',
'change': '1',

Loading…
Cancel
Save