From 979b6f038697159cd296d375709bbda7d39a0214 Mon Sep 17 00:00:00 2001 From: MMXX Date: Fri, 24 Dec 2021 16:49:19 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=89=8D=E7=AB=AF=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fir_client/src/components/FirBase.vue | 4 +- .../src/components/apps/FirAppInfosBase.vue | 23 ++------ .../components/apps/FirAppInfossecurity.vue | 2 +- .../components/apps/FirAppInfostimeline.vue | 23 +++----- fir_client/src/components/apps/FirApps.vue | 8 +-- fir_client/src/components/base/BindDomain.vue | 15 +++-- .../src/components/user/FirUserAdvert.vue | 3 +- .../src/components/user/FirUserDomain.vue | 59 +++++++++++++++---- .../src/components/user/FirUserQrcode.vue | 27 +++++---- fir_client/src/store/index.js | 4 +- 10 files changed, 95 insertions(+), 73 deletions(-) diff --git a/fir_client/src/components/FirBase.vue b/fir_client/src/components/FirBase.vue index 55622e7..923b291 100644 --- a/fir_client/src/components/FirBase.vue +++ b/fir_client/src/components/FirBase.vue @@ -18,7 +18,7 @@ effect="dark" type="error">
- 应用分发请绑定您自己的域名,平台分发域名可能因不可违因素更换,将导致您的应用无法访问 + 应用分发请绑定您自己的域名,平台分发域名可能因不可违因素更换,将导致您的应用无法访问 立即绑定
@@ -118,7 +118,7 @@ export default { padding-top: 30px; } -.domian-tip-bar { +.domain-tip-bar { line-height: 43px; color: #fff; font-weight: 500; diff --git a/fir_client/src/components/apps/FirAppInfosBase.vue b/fir_client/src/components/apps/FirAppInfosBase.vue index 6561efa..99e270f 100644 --- a/fir_client/src/components/apps/FirAppInfosBase.vue +++ b/fir_client/src/components/apps/FirAppInfosBase.vue @@ -15,7 +15,6 @@
@@ -24,7 +23,7 @@ :logoScale="qrinfo.logoScale" :logoSrc="icon_url" :margin="qrinfo.margin" :size="266" - :text="short_url()"> + :text="short_url(appinfos)"> 保存本地
@@ -51,7 +50,7 @@
该应用被封禁,请联系管理员 - + 预览
@@ -150,11 +149,8 @@ export default { //合成函数,执行下载 a.dispatchEvent(new MouseEvent('click')) }, - short_url() { - const userinfo = this.$store.state.userinfo; - if (userinfo && userinfo.role > 1 && userinfo.qrcode_domain_name.length > 3) { - return 'http://' + userinfo.qrcode_domain_name + '/' + this.appinfos.short; - } + short_url(appinfo) { + return appinfo.preview_url+ '/' + appinfo.short; }, setfunactive(item, index) { for (let key in this.$refs) { @@ -171,15 +167,8 @@ export default { } } }, - appDownload() { - let routeData = this.$router.resolve({name: 'FirDownload', params: {short: this.appinfos.short}}); - // window.open(routeData.href, '_blank'); - let p_url = routeData.href; - // let p_url = location.origin + '/' + this.appinfos.short; - if (this.appinfos.preview_url && this.appinfos.preview_url.length > 6) { - p_url = this.appinfos.preview_url + p_url - } - window.open(p_url, '_blank', ''); + appDownload(appinfo) { + window.open(this.short_url(appinfo), '_blank', ''); }, defaulttimeline() { this.setfunactive('timeline', 5); diff --git a/fir_client/src/components/apps/FirAppInfossecurity.vue b/fir_client/src/components/apps/FirAppInfossecurity.vue index 76c3a62..0c59317 100644 --- a/fir_client/src/components/apps/FirAppInfossecurity.vue +++ b/fir_client/src/components/apps/FirAppInfossecurity.vue @@ -7,7 +7,7 @@ title="绑定应用专属下载页域名" width="666px"> + :c_domain_name="this.currentapp.domain_name" transitionName="bind-app-domain"/> diff --git a/fir_client/src/components/apps/FirAppInfostimeline.vue b/fir_client/src/components/apps/FirAppInfostimeline.vue index 6809286..77fe0cf 100644 --- a/fir_client/src/components/apps/FirAppInfostimeline.vue +++ b/fir_client/src/components/apps/FirAppInfostimeline.vue @@ -78,7 +78,7 @@ - 预览 @@ -98,7 +98,7 @@ - 显示更多版本 + 显示更多版本 @@ -143,20 +143,15 @@ export default { 'app_id': this.currentapp.app_id }) }, - previewRelase(app) { + previewRelease(app) { let routeData = this.$router.resolve({ name: 'FirDownload', params: {short: this.currentapp.short}, query: {release_id: app.release_id} }); - let p_url = routeData.href; - if (this.currentapp.preview_url && this.currentapp.preview_url.length > 6) { - p_url = this.currentapp.preview_url + p_url - } - window.open(p_url, 'target', ''); - + window.open(this.currentapp.preview_url + routeData.href, 'target', ''); }, - getapptimelineFun(act = '') { + getAppTimelineFun(act = '') { const loading = this.$loading({ lock: true, text: '加载中', @@ -207,7 +202,7 @@ export default { message: '删除成功', type: 'success' }); - this.getapptimelineFun(); + this.getAppTimelineFun(); } else { this.$message({ @@ -232,10 +227,6 @@ export default { }); this.release_apps = data.data.release_apps; this.currentapp = data.data.currentapp; - // this.getapptimelineFun(); - // this.currentapp["icon_url"] = this.currentapp.master_release.icon_url; - // this.$store.dispatch('doucurrentapp', this.currentapp); - } else { this.$message({ message: '更新失败,请联系管理员', @@ -294,7 +285,7 @@ export default { }, watch: {}, computed: {}, mounted() { this.$store.dispatch('doappInfoIndex', [[5, 5], [5, 5]]); - this.getapptimelineFun(); + this.getAppTimelineFun(); }, filters: { downcontent(content) { if (content) { diff --git a/fir_client/src/components/apps/FirApps.vue b/fir_client/src/components/apps/FirApps.vue index c50c36d..5536849 100644 --- a/fir_client/src/components/apps/FirApps.vue +++ b/fir_client/src/components/apps/FirApps.vue @@ -1140,13 +1140,7 @@ export default { this.$router.push({name: 'FirAppInfostimeline', params: {id: app.app_id}}) }, appDownload(app) { - // this.$router.push({name: 'FirDownload', params: {short: app.short}}); - let routeData = this.$router.resolve({name: 'FirDownload', params: {short: app.short}}); - let p_url = routeData.href; - if (app.preview_url && app.preview_url.length > 6) { - p_url = app.preview_url + p_url - } - window.open(p_url, '_blank', ''); + window.open(app.preview_url+ '/' + app.short, '_blank', ''); } }, computed: { getDelappTitle() { diff --git a/fir_client/src/components/base/BindDomain.vue b/fir_client/src/components/base/BindDomain.vue index b1aa893..93c1203 100644 --- a/fir_client/src/components/base/BindDomain.vue +++ b/fir_client/src/components/base/BindDomain.vue @@ -170,14 +170,18 @@ export default { type: Boolean, default: false }, + c_domain_name: { + type: String, + default: '' + }, }, data() { return { active: 1, bind_status: false, bind_domain_sure: true, - domain_name: '', domain_tData: [{'type': 'CNAME', 'host': 'xxx', 'dns': 'demo.xxx.cn'}], + domain_name:'', force_bind: false, b_t_msg: '您的账户', } @@ -186,6 +190,9 @@ export default { if (this.domain_type === 2) { this.b_t_msg = '您的应用' } + if(this.c_domain_name){ + this.domain_name = this.c_domain_name + } this.bind_click(); }, beforeDestroy() { @@ -218,7 +225,7 @@ export default { this.bind_status = false; this.$message.error("绑定失败 " + data.msg) } - }, {methods: 'PUT', data: {app_id: this.app_id, domain_type: this.domain_type}}) + }, {methods: 'PUT', data: {app_id: this.app_id, domain_type: this.domain_type, domain_name:this.domain_name}}) }, remove_domain() { domainFun(data => { @@ -237,7 +244,7 @@ export default { } else { this.$message.error("解除绑定失败 " + data.msg) } - }, {methods: 'DELETE', data: {app_id: this.app_id, domain_type: this.domain_type}}); + }, {methods: 'DELETE', data: {app_id: this.app_id, domain_type: this.domain_type, domain_name:this.domain_name}}); }, bind_click() { this.$store.dispatch("dosetdomainstate", false); @@ -260,7 +267,7 @@ export default { } else { this.$message.error("绑定失败 " + data.msg) } - }, {methods: 'GET', data: {app_id: this.app_id, domain_type: this.domain_type}}); + }, {methods: 'GET', data: {app_id: this.app_id, domain_type: this.domain_type, domain_name:this.domain_name}}); }, format_domain_tData(cname_domain) { let domain_name_list = this.domain_name.split('.'); diff --git a/fir_client/src/components/user/FirUserAdvert.vue b/fir_client/src/components/user/FirUserAdvert.vue index f0e5786..5829558 100644 --- a/fir_client/src/components/user/FirUserAdvert.vue +++ b/fir_client/src/components/user/FirUserAdvert.vue @@ -54,7 +54,7 @@ action="#" drag style="max-height: 200px"> - + @@ -64,6 +64,7 @@ + 权重越大,广告展示频率越高 + :domain_type="current_domain_info.domain_type" :c_domain_name="current_domain_info.domain_name" transitionName="bind-app-domain"/>
- - 设置下载页域名 - - - 设置下载码域名 - + + + 添加下载页域名 + + + + + 设置下载码域名 + + +
@@ -96,6 +100,30 @@ + + + { + if (data.code === 1000) { + this.$message.success("权重修改成功") + + } else { + this.$message.error("权重修改失败 "+data.msg) + } + }, {methods: 'PUT', data: domain_info}) + }, show_bind_domain_info(domain_info) { this.bind_domain_sure = true; let app_id = null; @@ -152,6 +190,7 @@ export default { } this.current_domain_info.app_id = app_id; this.current_domain_info.domain_type = domain_info.domain_type; + this.current_domain_info.domain_name = domain_info.domain_name; this.domain_title = this.format_domain_type(domain_info) + ' 绑定详情'; }, appInfos(app_info) { @@ -226,8 +265,8 @@ export default { getUserInfoFun(this); this.get_data_from_tabname(); }, watch: { - '$store.state.domian_show_state': function () { - if (this.$store.state.domian_show_state) { + '$store.state.domain_show_state': function () { + if (this.$store.state.domain_show_state) { this.bind_domain_sure = false; this.get_data_from_tabname(); } diff --git a/fir_client/src/components/user/FirUserQrcode.vue b/fir_client/src/components/user/FirUserQrcode.vue index 8bfa731..2cbe6be 100644 --- a/fir_client/src/components/user/FirUserQrcode.vue +++ b/fir_client/src/components/user/FirUserQrcode.vue @@ -64,8 +64,15 @@   {{ appinfo.name }}
- 预览 - 保存本地 + + {{ short_url(appinfo) }} +
+ 预览 + 保存本地 +
+
@@ -113,6 +120,9 @@ export default { } }, methods: { + copy_success() { + this.$message.success('复制剪切板成功'); + }, auto_load() { if (getScrollTop() + getWindowHeight() >= getScrollHeight()) { if (this.has_next) { //先判断下一页是否有数据 @@ -203,23 +213,14 @@ export default { this.isIndeterminate = checkedCount > 0 && checkedCount < this.allQrcodeAppid.length; }, go_download(appinfo) { - let routeData = this.$router.resolve({name: 'FirDownload', params: {short: appinfo.short}}); - let p_url = routeData.href; - if (appinfo.preview_url && appinfo.preview_url.length > 6) { - p_url = appinfo.preview_url + p_url - } - window.open(p_url, '_blank', ''); + window.open(this.short_url(appinfo), '_blank', ''); }, qrback(dataUrl, id) { this.qrcode_img_info[id] = dataUrl; this.allQrcodeAppid.push(id); }, short_url(appinfo) { - const userinfo = this.$store.state.userinfo; - if (userinfo.qrcode_domain_name && userinfo.qrcode_domain_name.length > 3) { - return 'http://' + userinfo.qrcode_domain_name + '/' + appinfo.short; - } - return appinfo.preview_url; + return appinfo.preview_url+ '/' + appinfo.short; }, save_qr(appinfo) { let dtype = "I"; diff --git a/fir_client/src/store/index.js b/fir_client/src/store/index.js index 53bb3b0..f1614d3 100644 --- a/fir_client/src/store/index.js +++ b/fir_client/src/store/index.js @@ -17,7 +17,7 @@ const store = new Vuex.Store({ userInfoIndex: 0, show_domain_msg: false, domain_action: false, - domian_show_state: false, + domain_show_state: false, }, mutations: { setuserinfo(state, data) { @@ -39,7 +39,7 @@ const store = new Vuex.Store({ state.domain_action = val }, setdomainstate(state, val) { - state.domian_show_state = val + state.domain_show_state = val } }, actions: {