优化代码

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. 14
      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-dropdown-menu slot="dropdown">
<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="storage" v-if="$store.state.userinfo.storage_active">存储管理
</el-dropdown-item>
@ -101,8 +100,6 @@
handleCommand(command) {
if (command === 'userinfo') {
this.$router.push({name: 'FirUserProfileInfo'})
} else if (command === 'chpasswd') {
this.$router.push({name: 'FirUserProfileChangePwd'})
} else if (command === 'storage') {
this.$router.push({name: 'FirUserStorage', params: {act: "change"}})
} 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() {
this.appName = this.$route.params.id
}, watch: {
$route: function () {
this.appName = this.$route.params.id;
if (this.$route.meta) {
this.route_info.label = this.$route.meta.label;
this.route_info.name = this.$route.name;
}
this.init_route_name();
}
}, mounted() {
this.init_route_name();
}
}
</script>

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

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

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

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

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

@ -111,7 +111,7 @@
v-model="order_id_seach"
clearable
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>
@ -223,7 +223,7 @@
<script>
import {my_order, userinfos} from "@/restful";
import {my_order} from "@/restful";
export default {
name: "FirUserOrders",
@ -364,18 +364,7 @@
this.loading = false;
}, {methods: 'GET', data: params})
},
getUserInfoFun() {
userinfos(data => {
if (data.code === 1000) {
this.$store.dispatch("doUserinfo", data.data);
} else {
this.$message.error("用户信息获取失败")
}
}, {"methods": "GET"})
},
}, mounted() {
this.getUserInfoFun();
this.get_data_from_tabname()
}, filters: {}
}

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

@ -305,7 +305,7 @@
</template>
<script>
import {getStorageinfo, userinfos} from "@/restful";
import {getStorageinfo} from "@/restful";
import {deepCopy} from "@/utils";
export default {
@ -334,15 +334,6 @@
loading: false,
}
}, methods: {
getUserInfoFun() {
userinfos(data => {
if (data.code === 1000) {
this.$store.dispatch("doUserinfo", data.data);
} else {
this.$message.error("用户信息获取失败")
}
}, {"methods": "GET"})
},
showstorage(editstorageinfo) {
this.title = '查看存储信息';
this.disabled = true;
@ -536,7 +527,6 @@
}
},
}, mounted() {
this.getUserInfoFun();
if (this.$route.params.act) {
let activeName = this.$route.params.act;
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',
name: 'FirSuperSignBase',
meta: {label: '超级签名'},
path: 'supersign',
component: () => import("@/components/user/FirSuperSignBase"),
}
]
},
{
path: '/user/storage',
component: () => import("@/components/FirBase"),
children: [
children: [
{
path: ':act',
name: 'FirSuperSignBase',
meta: {label: '超级签名'},
}
]
},
{
path: ':act',
name: 'FirUserStorage',
meta: {label: '存储管理'},
path: 'storage',
component: () => import("@/components/user/FirUserStorage"),
}
]
},
{
path: '/user/orders',
component: () => import("@/components/FirBase"),
children: [
children: [
{
path: ':act',
name: 'FirUserStorage',
meta: {label: '存储管理'},
}
]
},
{
path: '',
path: 'orders',
name: 'FirUserOrders',
meta: {label: '订单详情'},
component: () => import("@/components/user/FirUserOrders"),
},
}
]
},
{
path: '/login',
name: 'FirLogin',
component: () => import("@/components/FirLogin"),
},
{
path: '/register',
name: 'FirRegist',
@ -163,7 +152,6 @@ const router = new VueRouter({
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) {
uploadstorage(certinfo, file, successcallback, processcallback)
@ -557,4 +557,14 @@ export function AvatarUploadUtils(fthis, file, params, callabck) {
}
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):
dependencies = [
('api', '0035_usercertificationinfo_reviewed_time'),
]
@ -15,6 +14,7 @@ class Migration(migrations.Migration):
migrations.AlterField(
model_name='usercertificationinfo',
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.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.utils.serializer import AppsSerializer, AppReleaseSerializer, UserInfoSerializer
from api.utils.serializer import AppsSerializer, AppReleaseSerializer
from rest_framework.pagination import PageNumberPagination
import logging
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)})
userserializer = UserInfoSerializer(request.user)
res.userinfo = {}
res.has_next = {}
res.userinfo = userserializer.data
res.data = app_serializer.data
res.has_next = page_obj.page.has_next()
return Response(res.dict)
@ -117,10 +115,6 @@ class AppInfoView(APIView):
res.msg = "未找到该应用"
res.code = 1003
userserializer = UserInfoSerializer(request.user)
res.userinfo = {}
res.userinfo = userserializer.data
return Response(res.dict)
def delete(self, request, app_id):
@ -206,8 +200,6 @@ class AppInfoView(APIView):
if user_admin_obj:
apps_obj.domain_name = domain_name
else:
serializer = UserInfoSerializer(request.user)
res.data = serializer.data
res.code = 1004
res.msg = "域名设置失败,请更换其他域名"
return Response(res.dict)

Loading…
Cancel
Save