优化代码

pull/16/head
nineven 4 years ago
parent 00f70627ae
commit 30e7e69ff8
  1. BIN
      fir_client/src/assets/wx_pay.jpg
  2. 18
      fir_client/src/components/FirHeader.vue
  3. 14
      fir_client/src/components/apps/FirAppInfosBase.vue
  4. 3
      fir_client/src/components/apps/FirAppInfosbaseinfo.vue
  5. 28
      fir_client/src/components/apps/FirAppInfoscombo.vue
  6. 5
      fir_client/src/components/apps/FirApps.vue
  7. 16
      fir_client/src/components/user/FirSuperSignBase.vue
  8. 15
      fir_client/src/components/user/FirUserOrders.vue
  9. 2
      fir_client/src/components/user/FirUserProfileInfo.vue
  10. 12
      fir_client/src/components/user/FirUserStorage.vue
  11. 66
      fir_client/src/router/index.js
  12. 12
      fir_client/src/utils/index.js
  13. 4
      fir_ser/api/migrations/0036_auto_20210409_1512.py
  14. 10
      fir_ser/api/views/apps.py

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 KiB

@ -49,7 +49,6 @@
</el-button> </el-button>
<el-dropdown-menu slot="dropdown"> <el-dropdown-menu slot="dropdown">
<el-dropdown-item command="userinfo">个人资料</el-dropdown-item> <el-dropdown-item command="userinfo">个人资料</el-dropdown-item>
<el-dropdown-item command="chpasswd">修改密码</el-dropdown-item>
<el-dropdown-item command="apitoken">API token</el-dropdown-item> <el-dropdown-item command="apitoken">API token</el-dropdown-item>
<el-dropdown-item command="storage" v-if="$store.state.userinfo.storage_active">存储管理 <el-dropdown-item command="storage" v-if="$store.state.userinfo.storage_active">存储管理
</el-dropdown-item> </el-dropdown-item>
@ -101,8 +100,6 @@
handleCommand(command) { handleCommand(command) {
if (command === 'userinfo') { if (command === 'userinfo') {
this.$router.push({name: 'FirUserProfileInfo'}) this.$router.push({name: 'FirUserProfileInfo'})
} else if (command === 'chpasswd') {
this.$router.push({name: 'FirUserProfileChangePwd'})
} else if (command === 'storage') { } else if (command === 'storage') {
this.$router.push({name: 'FirUserStorage', params: {act: "change"}}) this.$router.push({name: 'FirUserStorage', params: {act: "change"}})
} else if (command === 'supersign') { } else if (command === 'supersign') {
@ -137,18 +134,23 @@
} }
}, {}) }, {})
} }
} },
init_route_name() {
if (this.$route.meta) {
this.route_info.label = this.$route.meta.label;
this.route_info.name = this.$route.name;
}
},
}, created() { }, created() {
this.appName = this.$route.params.id this.appName = this.$route.params.id
}, watch: { }, watch: {
$route: function () { $route: function () {
this.appName = this.$route.params.id; this.appName = this.$route.params.id;
if (this.$route.meta) { this.init_route_name();
this.route_info.label = this.$route.meta.label;
this.route_info.name = this.$route.name;
}
} }
}, mounted() {
this.init_route_name();
} }
} }
</script> </script>

@ -86,8 +86,6 @@
:max="100"> :max="100">
</el-slider> </el-slider>
</div> </div>
<el-container style="padding-top: 20px;max-width: 96%"> <el-container style="padding-top: 20px;max-width: 96%">
<router-view></router-view> <router-view></router-view>
</el-container> </el-container>
@ -100,6 +98,7 @@
<script> <script>
import {apputils} from "@/restful"; import {apputils} from "@/restful";
import VueQr from 'vue-qr'; import VueQr from 'vue-qr';
import {getUserInfoFun} from "@/utils";
export default { export default {
name: "FirAppInfosBase", name: "FirAppInfosBase",
@ -188,15 +187,7 @@
}, },
devices() { devices() {
this.setfunactive('devices', 70); this.setfunactive('devices', 70);
// if (this.appinfos.issupersign) {
// this.$router.push({
// "name": 'FirSuperSignBase',
// params: {act: "useddevices"},
// query: {bundleid: this.appinfos.bundle_id}
// })
// } else {
this.$router.push({name: 'FirAppInfosdevices'}); this.$router.push({name: 'FirAppInfosdevices'});
// }
}, },
supersign() { supersign() {
this.setfunactive('supersign', 57); this.setfunactive('supersign', 57);
@ -219,12 +210,11 @@
}, },
}, },
computed: {}, mounted() { computed: {}, mounted() {
getUserInfoFun(this);
apputils(data => { apputils(data => {
if (data.code === 1000) { if (data.code === 1000) {
this.appinfos = data.data; this.appinfos = data.data;
this.master_release = data.data.master_release; this.master_release = data.data.master_release;
this.$store.dispatch("doUserinfo", data.userinfo);
this.appinfos["icon_url"] = this.master_release.icon_url; this.appinfos["icon_url"] = this.master_release.icon_url;
this.$store.dispatch('doucurrentapp', this.appinfos); this.$store.dispatch('doucurrentapp', this.appinfos);
this.short_full_url = this.appinfos.preview_url + "/" + this.appinfos.short; this.short_full_url = this.appinfos.preview_url + "/" + this.appinfos.short;

@ -167,14 +167,11 @@
}, },
getappinfo() { getappinfo() {
apputils(data => { apputils(data => {
if (data.code === 1000) { if (data.code === 1000) {
this.appinfos = data.data; this.appinfos = data.data;
this.master_release = data.data.master_release; this.master_release = data.data.master_release;
this.$store.dispatch("doUserinfo", data.userinfo);
this.appinfos["icon_url"] = this.master_release.icon_url; this.appinfos["icon_url"] = this.master_release.icon_url;
this.$store.dispatch('doucurrentapp', this.appinfos); this.$store.dispatch('doucurrentapp', this.appinfos);
} else if (data.code === 1003) { } else if (data.code === 1003) {
this.$router.push({name: 'FirApps'}); this.$router.push({name: 'FirApps'});
} else { } else {

@ -11,18 +11,19 @@
</tr> </tr>
<tr> <tr>
<td> <td>
<div class="icon"><img :src="cmaster_release.icon_url" class="ng-isolate-scope"> <div class="icon"><img v-if="cmaster_release" :src="cmaster_release.icon_url"
class="ng-isolate-scope">
</div> </div>
</td> </td>
<td><i class="icon-combo"></i></td> <td><i class="icon-combo"></i></td>
<td> <td>
<div class="icon"><img :src="hmaster_release.icon_url" class="ng-isolate-scope"> <div class="icon"><img v-if="hmaster_release" :src="hmaster_release.icon_url"
class="ng-isolate-scope">
</div> </div>
</td> </td>
</tr> </tr>
<tr> <tr>
<td class="actions" colspan="3"> <td class="actions" colspan="3">
<!-- <a class="btn btn-link " @click="each_confirm"><b>解除合并</b></a>-->
<el-button @click="each_confirm" round>解除合并</el-button> <el-button @click="each_confirm" round>解除合并</el-button>
</td> </td>
</tr> </tr>
@ -30,7 +31,7 @@
</div> </div>
<div v-else> <div v-else>
<div class="icon-container text-center"> <div class="icon-container text-center">
<img :src="cmaster_release.icon_url" height="128" width="128"> <img v-if="cmaster_release" :src="cmaster_release.icon_url" height="128" width="128">
</div> </div>
<div class="apps-list"> <div class="apps-list">
<div class="known-apps"> <div class="known-apps">
@ -114,12 +115,9 @@
apputils(data => { apputils(data => {
if (data.code === 1000) { if (data.code === 1000) {
this.$message.success('操作成功'); this.$message.success('操作成功');
this.comboapplists = []; this.comboapplists = [];
apputils(data => { apputils(data => {
let appinfos = {}; let appinfos = data.data;
appinfos = data.data;
appinfos["icon_url"] = appinfos.master_release.icon_url; appinfos["icon_url"] = appinfos.master_release.icon_url;
this.$store.dispatch('doucurrentapp', appinfos); this.$store.dispatch('doucurrentapp', appinfos);
@ -128,19 +126,14 @@
} else if (data.code === 1003) { } else if (data.code === 1003) {
this.$router.push({name: 'FirApps'}); this.$router.push({name: 'FirApps'});
} else { } else {
// eslint-disable-next-line no-console // eslint-disable-next-line no-console
console.log("Error"); console.log("Error");
} }
}, { }, {
"methods": "GET", "methods": "GET",
"app_id": this.currentapp.app_id "app_id": this.currentapp.app_id
}); });
this.setData(); this.setData();
} }
}, { }, {
"methods": "PUT", "methods": "PUT",
@ -179,10 +172,8 @@
}); });
}, },
setData() { setData() {
this.currentapp = this.$store.state.currentapp; this.currentapp = this.$store.state.currentapp;
this.cmaster_release = this.$store.state.currentapp.master_release; this.cmaster_release = this.$store.state.currentapp.master_release;
if (this.$store.state.currentapp.has_combo) { if (this.$store.state.currentapp.has_combo) {
this.has_combo = this.$store.state.currentapp.has_combo; this.has_combo = this.$store.state.currentapp.has_combo;
this.hmaster_release = this.$store.state.currentapp.has_combo.master_release; this.hmaster_release = this.$store.state.currentapp.has_combo.master_release;
@ -209,7 +200,10 @@
} }
}, filters: { }, filters: {
geticon_url(app) { geticon_url(app) {
return app.icon_url if (app) {
return app.icon_url
}
return ""
}, },
getapptype: function (type) { getapptype: function (type) {
let ftype = ''; let ftype = '';
@ -223,8 +217,6 @@
}, },
mounted() { mounted() {
this.$store.dispatch('doappInfoIndex', [[44, 44], [44, 44]]); this.$store.dispatch('doappInfoIndex', [[44, 44], [44, 44]]);
// this.getappiconFun();
this.setData(); this.setData();
}, },
watch: { watch: {

@ -486,6 +486,7 @@
uploadlocalstorage, uploadlocalstorage,
uploadqiniuoss uploadqiniuoss
} from "@/utils"; } from "@/utils";
import {getUserInfoFun} from "../../utils";
export default { export default {
name: "FirApps", name: "FirApps",
@ -796,10 +797,7 @@
this.has_next = data.has_next; this.has_next = data.has_next;
this.orgapplists = this.applists.slice(); // this.orgapplists = this.applists.slice(); //
this.hdata = data.hdata; this.hdata = data.hdata;
this.$store.dispatch("doUserinfo", data.userinfo);
this.searchapps(); this.searchapps();
// this.$store.dispatch('doucurrentapp', {'firapps':1});
} else { } else {
this.loadingobj.close(); this.loadingobj.close();
@ -933,6 +931,7 @@
} }
}, mounted() { }, mounted() {
getUserInfoFun(this);
this.$store.dispatch('doucurrentapp', {}); this.$store.dispatch('doucurrentapp', {});
this.getappsFun({}); this.getappsFun({});
}, },

@ -437,8 +437,8 @@
<script> <script>
import {iosdeveloper, iosdevices, iosdevicesudid, userinfos} from "@/restful"; import {iosdeveloper, iosdevices, iosdevicesudid} from "@/restful";
import {IsNum, removeAaary} from "@/utils"; import {getUserInfoFun, IsNum, removeAaary} from "@/utils";
export default { export default {
name: "FirSuperSignBase", name: "FirSuperSignBase",
@ -729,18 +729,8 @@
"methods": action, "data": data "methods": action, "data": data
}) })
}, },
getUserInfoFun() {
userinfos(data => {
if (data.code === 1000) {
this.$store.dispatch("doUserinfo", data.data);
} else {
this.$message.error("用户信息获取失败")
}
}, {"methods": "GET"})
},
}, mounted() { }, mounted() {
this.getUserInfoFun(); getUserInfoFun(this);
if (this.$route.params.act) { if (this.$route.params.act) {
let activeName = this.$route.params.act; let activeName = this.$route.params.act;
let activeName_list = ["useddevices", "devicesudid", "adddeveloper", "iosdeveloper"]; let activeName_list = ["useddevices", "devicesudid", "adddeveloper", "iosdeveloper"];

@ -111,7 +111,7 @@
v-model="order_id_seach" v-model="order_id_seach"
clearable clearable
placeholder="输入订单ID"/> placeholder="输入订单ID"/>
<el-button type="primary" icon="el-icon-search" @click="handleCurrentChange(pagination.currentPage)"> <el-button type="primary" icon="el-icon-search" @click="handleCurrentChange(1)">
搜索 搜索
</el-button> </el-button>
@ -223,7 +223,7 @@
<script> <script>
import {my_order, userinfos} from "@/restful"; import {my_order} from "@/restful";
export default { export default {
name: "FirUserOrders", name: "FirUserOrders",
@ -364,18 +364,7 @@
this.loading = false; this.loading = false;
}, {methods: 'GET', data: params}) }, {methods: 'GET', data: params})
}, },
getUserInfoFun() {
userinfos(data => {
if (data.code === 1000) {
this.$store.dispatch("doUserinfo", data.data);
} else {
this.$message.error("用户信息获取失败")
}
}, {"methods": "GET"})
},
}, mounted() { }, mounted() {
this.getUserInfoFun();
this.get_data_from_tabname() this.get_data_from_tabname()
}, filters: {} }, filters: {}
} }

@ -250,8 +250,6 @@
}, },
updateUserInfo(datainfo) { updateUserInfo(datainfo) {
userinfos(data => { userinfos(data => {
if (data.code === 1000) { if (data.code === 1000) {
this.userinfo = data.data; this.userinfo = data.data;

@ -305,7 +305,7 @@
</template> </template>
<script> <script>
import {getStorageinfo, userinfos} from "@/restful"; import {getStorageinfo} from "@/restful";
import {deepCopy} from "@/utils"; import {deepCopy} from "@/utils";
export default { export default {
@ -334,15 +334,6 @@
loading: false, loading: false,
} }
}, methods: { }, methods: {
getUserInfoFun() {
userinfos(data => {
if (data.code === 1000) {
this.$store.dispatch("doUserinfo", data.data);
} else {
this.$message.error("用户信息获取失败")
}
}, {"methods": "GET"})
},
showstorage(editstorageinfo) { showstorage(editstorageinfo) {
this.title = '查看存储信息'; this.title = '查看存储信息';
this.disabled = true; this.disabled = true;
@ -536,7 +527,6 @@
} }
}, },
}, mounted() { }, mounted() {
this.getUserInfoFun();
if (this.$route.params.act) { if (this.$route.params.act) {
let activeName = this.$route.params.act; let activeName = this.$route.params.act;
let activeName_list = ["change", "edit", "add"]; let activeName_list = ["change", "edit", "add"];

@ -102,55 +102,44 @@ const router = new VueRouter({
}, },
] ]
} },
]
},
{
path: '/login',
name: 'FirLogin',
component: () => import("@/components/FirLogin"),
},
{
path: '/user/supersign',
component: () => import("@/components/FirBase"),
children: [
{ {
path: ':act', path: 'supersign',
name: 'FirSuperSignBase',
meta: {label: '超级签名'},
component: () => import("@/components/user/FirSuperSignBase"), component: () => import("@/components/user/FirSuperSignBase"),
children: [
} {
] path: ':act',
}, name: 'FirSuperSignBase',
{ meta: {label: '超级签名'},
path: '/user/storage', }
component: () => import("@/components/FirBase"), ]
children: [ },
{ {
path: ':act', path: 'storage',
name: 'FirUserStorage',
meta: {label: '存储管理'},
component: () => import("@/components/user/FirUserStorage"), component: () => import("@/components/user/FirUserStorage"),
children: [
} {
] path: ':act',
}, name: 'FirUserStorage',
{ meta: {label: '存储管理'},
path: '/user/orders', }
component: () => import("@/components/FirBase"), ]
children: [ },
{ {
path: '', path: 'orders',
name: 'FirUserOrders', name: 'FirUserOrders',
meta: {label: '订单详情'}, meta: {label: '订单详情'},
component: () => import("@/components/user/FirUserOrders"), component: () => import("@/components/user/FirUserOrders"),
},
}
] ]
}, },
{
path: '/login',
name: 'FirLogin',
component: () => import("@/components/FirLogin"),
},
{ {
path: '/register', path: '/register',
name: 'FirRegist', name: 'FirRegist',
@ -163,7 +152,6 @@ const router = new VueRouter({
component: () => import("@/components/FirDownload"), component: () => import("@/components/FirDownload"),
}, },
] ]
}); });

@ -171,7 +171,7 @@ export function uploadaliyunoss(file, certinfo, app, successcallback, processcal
} }
import {getuploadurl, loginFun, uploadimgs, uploadstorage} from '@/restful' import {getuploadurl, loginFun, uploadimgs, uploadstorage, userinfos} from '@/restful'
export function uploadlocalstorage(file, certinfo, app, successcallback, processcallback) { export function uploadlocalstorage(file, certinfo, app, successcallback, processcallback) {
uploadstorage(certinfo, file, successcallback, processcallback) uploadstorage(certinfo, file, successcallback, processcallback)
@ -558,3 +558,13 @@ export function AvatarUploadUtils(fthis, file, params, callabck) {
return false; return false;
} }
export function getUserInfoFun(self) {
userinfos(data => {
if (data.code === 1000) {
self.$store.dispatch("doUserinfo", data.data);
} else {
self.$message.error("用户信息获取失败")
}
}, {"methods": "GET"})
}

@ -6,7 +6,6 @@ import django.db.models.deletion
class Migration(migrations.Migration): class Migration(migrations.Migration):
dependencies = [ dependencies = [
('api', '0035_usercertificationinfo_reviewed_time'), ('api', '0035_usercertificationinfo_reviewed_time'),
] ]
@ -15,6 +14,7 @@ class Migration(migrations.Migration):
migrations.AlterField( migrations.AlterField(
model_name='usercertificationinfo', model_name='usercertificationinfo',
name='user_id', name='user_id',
field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='certification', to=settings.AUTH_USER_MODEL, verbose_name='用户ID'), field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='certification',
to=settings.AUTH_USER_MODEL, verbose_name='用户ID'),
), ),
] ]

@ -13,7 +13,7 @@ from api.utils.app.supersignutils import IosUtils, resign_by_app_obj
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, del_cache_by_delete_app from api.utils.storage.caches import del_cache_response_by_short, get_app_today_download_times, del_cache_by_delete_app
from api.models import Apps, AppReleaseInfo, APPToDeveloper, AppIOSDeveloperInfo, UserInfo, AppScreenShot from api.models import Apps, AppReleaseInfo, APPToDeveloper, AppIOSDeveloperInfo, UserInfo, AppScreenShot
from api.utils.serializer import AppsSerializer, AppReleaseSerializer, UserInfoSerializer from api.utils.serializer import AppsSerializer, AppReleaseSerializer
from rest_framework.pagination import PageNumberPagination from rest_framework.pagination import PageNumberPagination
import logging import logging
from fir_ser.settings import SERVER_DOMAIN from fir_ser.settings import SERVER_DOMAIN
@ -91,10 +91,8 @@ class AppsView(APIView):
app_serializer = AppsSerializer(app_page_serializer, many=True, context={"storage": Storage(request.user)}) app_serializer = AppsSerializer(app_page_serializer, many=True, context={"storage": Storage(request.user)})
userserializer = UserInfoSerializer(request.user)
res.userinfo = {} res.userinfo = {}
res.has_next = {} res.has_next = {}
res.userinfo = userserializer.data
res.data = app_serializer.data res.data = app_serializer.data
res.has_next = page_obj.page.has_next() res.has_next = page_obj.page.has_next()
return Response(res.dict) return Response(res.dict)
@ -117,10 +115,6 @@ class AppInfoView(APIView):
res.msg = "未找到该应用" res.msg = "未找到该应用"
res.code = 1003 res.code = 1003
userserializer = UserInfoSerializer(request.user)
res.userinfo = {}
res.userinfo = userserializer.data
return Response(res.dict) return Response(res.dict)
def delete(self, request, app_id): def delete(self, request, app_id):
@ -206,8 +200,6 @@ class AppInfoView(APIView):
if user_admin_obj: if user_admin_obj:
apps_obj.domain_name = domain_name apps_obj.domain_name = domain_name
else: else:
serializer = UserInfoSerializer(request.user)
res.data = serializer.data
res.code = 1004 res.code = 1004
res.msg = "域名设置失败,请更换其他域名" res.msg = "域名设置失败,请更换其他域名"
return Response(res.dict) return Response(res.dict)

Loading…
Cancel
Save