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

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

@ -96,21 +96,9 @@ module.exports = {
'@': resolve('src') '@': 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 => { chainWebpack: config => {
if (page==='analyz') { if (page==='analyz') {
config config
.plugin('webpack-bundle-analyzer') .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'); // config.plugins.delete('preload');

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

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

@ -24,11 +24,14 @@ from api.base_views import app_delete
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
def get_release_apps(res, app_serializer, apps_obj, storage): def get_release_apps(request, res, app_serializer, apps_obj, storage):
res.data["currentapp"] = app_serializer.data page_obj = AppsPageNumber()
app_release_obj = AppReleaseInfo.objects.filter(app_id=apps_obj).all().order_by("-created_time") 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}) 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 res.data["release_apps"] = app_release_serializer.data
return res return res
@ -273,7 +276,7 @@ class AppReleaseinfoView(APIView):
if apps_obj: if apps_obj:
storage = Storage(request.user) storage = Storage(request.user)
app_serializer = AppsSerializer(apps_obj, context={"storage": storage}) 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: else:
res.msg = "未找到该应用" res.msg = "未找到该应用"
res.code = 1003 res.code = 1003
@ -297,6 +300,7 @@ class AppReleaseinfoView(APIView):
apprelease_count = AppReleaseInfo.objects.filter(app_id=apps_obj).values("release_id").count() 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() appreleaseobj = AppReleaseInfo.objects.filter(app_id=apps_obj, release_id=act).first()
if appreleaseobj:
if not appreleaseobj.is_master: if not appreleaseobj.is_master:
logger.info("delete app release %s" % (appreleaseobj)) logger.info("delete app release %s" % (appreleaseobj))
storage.delete_file(appreleaseobj.release_id, appreleaseobj.release_type) storage.delete_file(appreleaseobj.release_id, appreleaseobj.release_type)
@ -362,6 +366,6 @@ class AppReleaseinfoView(APIView):
del_cache_response_by_short(apps_obj.app_id) del_cache_response_by_short(apps_obj.app_id)
app_serializer = AppsSerializer(apps_obj) 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) return Response(res.dict)

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

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

Loading…
Cancel
Save