fix some bugs

super_signature
nineven 5 years ago
parent b8ebd2b8d9
commit b9a646f521
  1. 11
      fir_client/src/components/FirAppInfossecurity.vue
  2. 13
      fir_client/src/components/FirUserProfileStorage.vue
  3. 9
      fir_client/src/utils/index.js
  4. 16
      fir_ser/api/views/apps.py
  5. 3
      fir_ser/api/views/supersign.py
  6. 6
      fir_ser/nginx-vhost.conf

@ -67,12 +67,14 @@
<script> <script>
import { updateapp, } from "../restful" import { updateapp, } from "../restful"
import {deepCopy} from "../utils";
export default { export default {
name: "FirAppInfossecurity", name: "FirAppInfossecurity",
data() { data() {
return { return {
currentapp: {}, currentapp: {},
orgcurrentapp: {},
downtip:{'msg':''}, downtip:{'msg':''},
supersign:{'msg':''}, supersign:{'msg':''},
passwordtip:{'msg':''}, passwordtip:{'msg':''},
@ -93,6 +95,13 @@
this.$message.success('数据更新成功'); this.$message.success('数据更新成功');
}else { }else {
this.$message.error('操作失败,'+data.msg); this.$message.error('操作失败,'+data.msg);
this.currentapp=deepCopy(this.orgcurrentapp);
this.passwordflag=false;
this.showdownloadflag=false;
this.showsupersignflag=false;
this.setbuttondefault(this.currentapp);
} }
}, { }, {
"app_id": this.currentapp.app_id, "app_id": this.currentapp.app_id,
@ -242,11 +251,13 @@
} }
}, },
appinit(){ appinit(){
this.currentapp = this.$store.state.currentapp; this.currentapp = this.$store.state.currentapp;
this.passwordflag=false; this.passwordflag=false;
this.showdownloadflag=false; this.showdownloadflag=false;
this.showsupersignflag=false; this.showsupersignflag=false;
this.setbuttondefault(this.currentapp); this.setbuttondefault(this.currentapp);
this.orgcurrentapp=deepCopy(this.currentapp)
} }
}, },
mounted() { mounted() {

@ -197,6 +197,7 @@
<script> <script>
import {getStorageinfo} from "../restful"; import {getStorageinfo} from "../restful";
import {deepCopy} from "../utils";
export default { export default {
name: "FirUserProfileStorage", name: "FirUserProfileStorage",
@ -219,24 +220,18 @@
is_admin_storage:false, is_admin_storage:false,
} }
}, methods: { }, methods: {
deepCopy(source) {
let result={};
for (let key in source) {
result[key] = typeof source[key]==='object'? this.deepCopy(source[key]): source[key];
}
return result;
},
showstorage(editstorageinfo){ showstorage(editstorageinfo){
this.title='查看存储信息'; this.title='查看存储信息';
this.disabled=true; this.disabled=true;
this.dialogstorageVisible=true; this.dialogstorageVisible=true;
this.editstorageinfo=this.deepCopy(editstorageinfo); this.editstorageinfo=deepCopy(editstorageinfo);
}, },
editstorage(editstorageinfo){ editstorage(editstorageinfo){
this.title='存储编辑'; this.title='存储编辑';
this.disabled=false; this.disabled=false;
this.dialogstorageVisible=true; this.dialogstorageVisible=true;
this.editstorageinfo=this.deepCopy(editstorageinfo); this.editstorageinfo=deepCopy(editstorageinfo);
this.isaddflag=false; this.isaddflag=false;
},add_storage_click(){ },add_storage_click(){
this.title='新增存储'; this.title='新增存储';

@ -197,3 +197,12 @@ export function removeAaary(_arr, _obj) {
} }
} }
} }
//深拷贝
export function deepCopy(source) {
let result={};
for (let key in source) {
result[key] = typeof source[key]==='object'? deepCopy(source[key]): source[key];
}
return result;
}

@ -8,14 +8,14 @@ from rest_framework.views import APIView
from api.utils.response import BaseResponse from api.utils.response import BaseResponse
from api.utils.auth import ExpiringTokenAuthentication from api.utils.auth import ExpiringTokenAuthentication
from rest_framework.response import Response from rest_framework.response import Response
from django.db.models import Sum from django.db.models import Sum,F
import os import os
from fir_ser import settings from fir_ser import settings
from api.utils.app.supersignutils import IosUtils from api.utils.app.supersignutils import IosUtils
from api.utils.app.randomstrings import make_from_user_uuid from api.utils.app.randomstrings import make_from_user_uuid
from api.utils.storage.storage import Storage from api.utils.storage.storage import Storage
from api.utils.storage.caches import del_cache_response_by_short,get_app_today_download_times from api.utils.storage.caches import del_cache_response_by_short,get_app_today_download_times
from api.models import Apps, AppReleaseInfo,APPToDeveloper from api.models import Apps, AppReleaseInfo,APPToDeveloper,AppIOSDeveloperInfo
from api.utils.serializer import AppsSerializer, AppReleaseSerializer, UserInfoSerializer from api.utils.serializer import AppsSerializer, AppReleaseSerializer, UserInfoSerializer
from rest_framework.pagination import PageNumberPagination from rest_framework.pagination import PageNumberPagination
@ -181,6 +181,18 @@ class AppInfoView(APIView):
apps_obj.password = data.get("password", apps_obj.password) apps_obj.password = data.get("password", apps_obj.password)
apps_obj.isshow = data.get("isshow", apps_obj.isshow) apps_obj.isshow = data.get("isshow", apps_obj.isshow)
if apps_obj.type == 1: if apps_obj.type == 1:
now_can_use_number=0
developer_obj = AppIOSDeveloperInfo.objects.filter(user_id=request.user)
use_number_dict = developer_obj.filter(is_actived=True).filter(use_number__lt=F("usable_number")).aggregate(
usable_number=Sum('usable_number'), use_number=Sum('use_number'))
if use_number_dict and use_number_dict.get("usable_number", 0) and use_number_dict.get(
"use_number", 0):
now_can_use_number = use_number_dict.get("usable_number", 0) - use_number_dict.get(
"use_number", 0)
if now_can_use_number == 0:
res.code = 1008
res.msg = "超级签余额不足,无法开启"
return Response(res.dict)
apps_obj.issupersign = data.get("issupersign", apps_obj.issupersign) apps_obj.issupersign = data.get("issupersign", apps_obj.issupersign)
apps_obj.save() apps_obj.save()
except Exception as e: except Exception as e:

@ -82,6 +82,9 @@ class DeveloperView(APIView):
if IosUtils.active_developer(developer_obj,code): if IosUtils.active_developer(developer_obj,code):
developer_obj.is_actived=True developer_obj.is_actived=True
developer_obj.save() developer_obj.save()
if developer_obj.certid and len(developer_obj.certid) > 6:
pass
else:
IosUtils.create_developer_cert(developer_obj,request.user) IosUtils.create_developer_cert(developer_obj,request.user)
else: else:
developer_obj.usable_number=data.get("usable_number",developer_obj.usable_number) developer_obj.usable_number=data.get("usable_number",developer_obj.usable_number)

@ -40,7 +40,7 @@ server
location ~ ^/(download|api|files) { location ~ ^/(download|api|files|udid) {
#proxy_pass http://synchrotron; #proxy_pass http://synchrotron;
include uwsgi_params; include uwsgi_params;
@ -48,12 +48,12 @@ server
uwsgi_param UWSGI_SCRIPT wsgi; uwsgi_param UWSGI_SCRIPT wsgi;
} }
location ~ ^/(index|apps|user|login) { location ~ ^/(index|apps|user|login|supersign) {
try_files $uri $uri/ /index.html; try_files $uri $uri/ /index.html;
} }
location / { location / {
try_files $uri $uri/ /appdownload/index.html; try_files $uri $uri/ /short.html;
} }

Loading…
Cancel
Save