增加应用微信内访问限制

super_signature
nineven 5 years ago
parent 5161f04fae
commit 33e16c9284
  1. 2
      fir_client/src/components/FirAppInfosBase.vue
  2. 140
      fir_client/src/components/FirAppInfossecurity.vue
  3. 39
      fir_client/src/components/FirDownload.vue
  4. 42
      fir_download/src/components/FirDownload.vue
  5. 23
      fir_ser/api/migrations/0007_auto_20200520_1153.py
  6. 2
      fir_ser/api/models.py
  7. 2
      fir_ser/api/utils/serializer.py
  8. 2
      fir_ser/api/views/apps.py

@ -27,7 +27,7 @@
</el-col> </el-col>
<el-col :span="3"> <el-col :span="3">
<a class="" ref="security" @click="security"><i class="el-icon-set-up"></i>权限管理</a> <a class="" ref="security" @click="security"><i class="el-icon-set-up"></i>应用管理</a>
</el-col> </el-col>
<el-col :span="3"> <el-col :span="3">

@ -1,48 +1,48 @@
<template> <template>
<div style="margin-top: 20px;width: 56%;margin-left: 8%"> <div style="margin-top: 20px;width: 66%;margin-left: 8%">
<el-form label-width="80px"> <el-form label-width="80px">
<el-form-item label-width="200px" label="访问密码">
<el-form-item label-width="160px" label="是否下载页显示"> <el-tooltip placement="top">
<div slot="content">
<el-tooltip :content="downtip.msg" placement="top"> {{passwordtip.msg}}<br>
<div v-if="passwordtip.val === 'on'">
<el-link icon="el-icon-edit" :underline="false" @click="setaccesspassword">修改</el-link>
</div>
</div>
<el-switch <el-switch
@change="showdownloadevent" v-model="passwordtip.val"
v-model="downtip.val" @change="showpasswordevent"
active-color="#13ce66" active-color="#13ce66"
inactive-color="#ff4949" inactive-color="#ff4949"
active-value="on" active-value="on"
inactive-value="off"> inactive-value="off">
</el-switch> </el-switch>
</el-tooltip> </el-tooltip>
<el-link :underline="false" style="margin-left: 20px" >设置密码之后用户需要输入密码才可以下载该应用</el-link>
</el-form-item> </el-form-item>
<el-form-item label-width="200px" label="下载页显示">
<el-form-item label-width="160px" label="是否开启访问密码"> <el-tooltip :content="downtip.msg" placement="top">
<el-tooltip placement="top">
<div slot="content">
{{passwordtip.msg}}<br>
<div v-if="passwordtip.val === 'on'">
<el-link icon="el-icon-edit" :underline="false" @click="setaccesspassword">修改</el-link>
</div>
</div>
<el-switch <el-switch
v-model="passwordtip.val" @change="showdownloadevent"
@change="showpasswordevent" v-model="downtip.val"
active-color="#13ce66" active-color="#13ce66"
inactive-color="#ff4949" inactive-color="#ff4949"
active-value="on" active-value="on"
inactive-value="off"> inactive-value="off">
</el-switch> </el-switch>
</el-tooltip> </el-tooltip>
<el-link :underline="false" style="margin-left: 20px" >默认开启关闭之后用户无法通过短连接访问下载该应用</el-link>
</el-form-item> </el-form-item>
<el-form-item v-if="currentapp.type === 1" label-width="160px" label="是否开启超级签名"> <el-form-item v-if="currentapp.type === 1" label-width="200px" label="自动超级签名">
<el-tooltip :content="supersign.msg" placement="top"> <el-tooltip :content="supersign.msg" placement="top">
<el-switch <el-switch
@ -57,6 +57,38 @@
<el-button @click="clean_app" v-if="currentapp.issupersign === 0 && currentapp.count !== 0" <el-button @click="clean_app" v-if="currentapp.issupersign === 0 && currentapp.count !== 0"
style="margin-left: 20px" size="small" type="info" plain>清理开发者账户脏数据 style="margin-left: 20px" size="small" type="info" plain>清理开发者账户脏数据
</el-button> </el-button>
<el-link v-else :underline="false" style="margin-left: 20px" >超级签名iOS专用需要配置好苹果开发者账户方可开启</el-link>
</el-form-item>
<el-form-item label-width="200px" label="微信内访问简易模式">
<el-tooltip :content="wxeasytypetip.msg" placement="top">
<el-switch
@change="wxeasytypeevent"
v-model="wxeasytypetip.val"
active-color="#13ce66"
inactive-color="#ff4949"
active-value="on"
inactive-value="off">
</el-switch>
</el-tooltip>
<el-link :underline="false" style="margin-left: 20px" >默认开启可以最大限度避免微信内举报封停</el-link>
</el-form-item>
<el-form-item label-width="200px" label="微信内访问跳转第三方平台">
<el-tooltip :content="wxredirecttip.msg" placement="top">
<el-switch
@change="wxredirectevent"
v-model="wxredirecttip.val"
active-color="#13ce66"
inactive-color="#ff4949"
active-value="on"
inactive-value="off">
</el-switch>
</el-tooltip>
<el-link :underline="false" style="margin-left: 20px" >默认开启如果配置第三方平台在微信内访问直接跳转</el-link>
</el-form-item> </el-form-item>
@ -80,9 +112,13 @@
downtip: {'msg': ''}, downtip: {'msg': ''},
supersign: {'msg': ''}, supersign: {'msg': ''},
passwordtip: {'msg': ''}, passwordtip: {'msg': ''},
wxeasytypetip: {'msg': ''},
wxredirecttip: {'msg': ''},
passwordflag: false, passwordflag: false,
showdownloadflag: false, showdownloadflag: false,
showsupersignflag: false, showsupersignflag: false,
wxeasytypeflag: false,
wxredirectflag: false,
clecount: 0 clecount: 0
} }
}, },
@ -141,10 +177,32 @@
} }
this.showsupersignflag = true; this.showsupersignflag = true;
}, },
setxeasytypeshow(currentapp) {
if (currentapp.wxeasytype === 1) {
this.wxeasytypeevent("on");
this.wxeasytypetip.val = 'on';
} else {
this.wxeasytypeevent("off");
this.wxeasytypetip.val = 'off';
}
this.wxeasytypeflag = true;
},
setwxredirectshow(currentapp) {
if (currentapp.wxredirect === 1) {
this.wxredirectevent("on");
this.wxredirecttip.val = 'on';
} else {
this.wxredirectevent("off");
this.wxredirecttip.val = 'off';
}
this.wxredirectflag = true;
},
setbuttondefault(currentapp) { setbuttondefault(currentapp) {
this.setbuttondefaltpass(currentapp); this.setbuttondefaltpass(currentapp);
this.setbuttondefaltshow(currentapp); this.setbuttondefaltshow(currentapp);
this.setbuttonsignshow(currentapp); this.setbuttonsignshow(currentapp);
this.setxeasytypeshow(currentapp);
this.setwxredirectshow(currentapp);
}, },
passwordswitch(state) { passwordswitch(state) {
this.passwordflag = false; this.passwordflag = false;
@ -253,12 +311,56 @@
this.passwordtip.msg = '无访问密码' this.passwordtip.msg = '无访问密码'
} }
}, },
wxeasytypeevent(newval) {
if (newval === "on") {
if (this.wxeasytypeflag) {
this.saveappinfo({
"wxeasytype": 1,
});
this.currentapp.wxeasytype = 1;
}
this.wxeasytypetip.msg = '已经开启微信内访问简易模式';
} else {
if (this.wxeasytypeflag) {
this.saveappinfo({
"wxeasytype": 0,
});
this.currentapp.wxeasytype = 0;
}
this.wxeasytypetip.msg = '关闭'
}
},
wxredirectevent(newval) {
if (newval === "on") {
if (this.wxredirectflag) {
this.saveappinfo({
"wxredirect": 1,
});
this.currentapp.wxredirect = 1;
}
this.wxredirecttip.msg = '已经开启微信内自动跳转第三方平台';
} else {
if (this.wxredirectflag) {
this.saveappinfo({
"wxredirect": 0,
});
this.currentapp.wxredirect = 0;
}
this.wxredirecttip.msg = '关闭'
}
},
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.wxeasytypeflag = false;
this.wxredirectflag = false;
this.setbuttondefault(this.currentapp); this.setbuttondefault(this.currentapp);
this.orgcurrentapp = deepCopy(this.currentapp) this.orgcurrentapp = deepCopy(this.currentapp)
} }

@ -18,9 +18,10 @@
<!-- <span class="pattern right"><img src="../assets/download_pattern_right.png"></span>--> <!-- <span class="pattern right"><img src="../assets/download_pattern_right.png"></span>-->
</div> </div>
<el-container class="out-container" v-if="agent !== 'wxandroid' && agent !== 'wxapple'" > <el-container class="out-container" v-if="wxeasytypeflag">
<div class="main"> <div class="main">
<!-- <div class="main" v-if="(agent !== 'wxandroid' && agent !== 'wxapple')">-->
<header> <header>
<div class="table-container"> <div class="table-container">
<div class="cell-container"> <div class="cell-container">
@ -60,7 +61,8 @@
<div id="actions" class="actions" v-if="agent !==''"> <div id="actions" class="actions" v-if="agent !==''">
<el-button type="info" round v-if="agent === 'wxandroid' || agent === 'wxapple'">不支持在微信内打开 <el-button type="info" round
v-if="agent === 'wxandroid' || agent === 'wxapple'">不支持在微信内下载
</el-button> </el-button>
<button type="button" v-else-if="wrong">{{ msg }}</button> <button type="button" v-else-if="wrong">{{ msg }}</button>
@ -188,6 +190,7 @@
downloadurl: "", downloadurl: "",
isdownload: false, isdownload: false,
udid: "", udid: "",
wxeasytypeflag: false,
} }
}, methods: { }, methods: {
download() { download() {
@ -243,11 +246,15 @@
} }
}, },
qrcode() { qrcode() {
new QRCode('qrcode', { let qrcode = document.getElementById("qrcode");
if (qrcode) {
new QRCode(qrcode, {
width: 100, width: 100,
height: 100, height: 100,
text: this.full_url, // text: location.href, //
}) })
}
}, },
getDownloadTokenFun() { getDownloadTokenFun() {
let params = {"short": this.$route.params.short, "time": new Date().getTime()}; let params = {"short": this.$route.params.short, "time": new Date().getTime()};
@ -333,14 +340,24 @@
this.miscomboappinfo = {}; this.miscomboappinfo = {};
this.iscomboappinfo = {}; this.iscomboappinfo = {};
} }
if(this.agent !== 'wxandroid' && this.agent !== 'wxapple'){ if (this.currentappinfo.wxeasytype) {
if (this.agent !== 'wxandroid' && this.agent !== 'wxapple') {
document.title = this.currentappinfo.name + '下载'; document.title = this.currentappinfo.name + '下载';
}else { this.wxeasytypeflag = true;
} else {
document.title = '请在浏览器中打开'; document.title = '请在浏览器中打开';
} }
} else {
document.title = this.currentappinfo.name + '下载';
this.wxeasytypeflag = true;
}
if (this.currentappinfo.wxredirect) {
if (this.mcurrentappinfo.binary_url && this.agent !== '' && this.wrong === false) { if (this.mcurrentappinfo.binary_url && this.agent !== '' && this.wrong === false) {
window.location.href = this.mcurrentappinfo.binary_url window.location.href = this.mcurrentappinfo.binary_url
} }
}
} else { } else {
this.$message({ this.$message({
message: data.msg, message: data.msg,
@ -392,6 +409,10 @@
} }
} }
if (this.agent === '') {
this.wxeasytypeflag = true;
}
} }
}, created() { }, created() {
this.getAgent(); this.getAgent();
@ -410,8 +431,10 @@
} }
return ftype return ftype
}, },
formatName:function (name){ formatName: function (name) {
return name.replace("麻将","").replace("斗地主","").replace("棋牌","") if (name) {
return name.replace("麻将", "").replace("斗地主", "").replace("棋牌", "")
}
}, },
formatTime: function (stime) { formatTime: function (stime) {
if (stime) { if (stime) {

@ -18,7 +18,7 @@
<!-- <span class="pattern right"><img src="../assets/download_pattern_right.png"></span>--> <!-- <span class="pattern right"><img src="../assets/download_pattern_right.png"></span>-->
</div> </div>
<div class="out-container container" v-if="agent !== 'wxandroid' && agent !== 'wxapple'"> <div class="out-container container" v-if="wxeasytypeflag">
<div v-show='mcurrentappinfo.release_id' class="main"> <div v-show='mcurrentappinfo.release_id' class="main">
<header> <header>
@ -56,7 +56,7 @@
<div id="actions" class="actions" v-if="agent !==''"> <div id="actions" class="actions" v-if="agent !==''">
<button type="info" round v-if="agent === 'wxandroid' || agent === 'wxapple'">不支持在微信内打开 <button type="info" round v-if="agent === 'wxandroid' || agent === 'wxapple'">不支持在微信内下载
</button> </button>
<button type="button" v-else-if="wrong">{{ msg }}</button> <button type="button" v-else-if="wrong">{{ msg }}</button>
@ -178,7 +178,10 @@
dchoice:false, dchoice:false,
downloadurl:"", downloadurl:"",
isdownload:false, isdownload:false,
iserror:false iserror:false,
udid: "",
wxeasytypeflag: false,
} }
}, methods: { }, methods: {
download() { download() {
@ -230,11 +233,14 @@
} }
}, },
qrcode(){ qrcode(){
new QRCode('qrcode', { let qrcode = document.getElementById("qrcode");
if (qrcode) {
new QRCode(qrcode, {
width: 100, width: 100,
height: 100, height: 100,
text: this.full_url, // text: location.href, //
}) })
}
}, },
getDownloadTokenFun() { getDownloadTokenFun() {
let params={ "short": this.$route.params.short,"time":new Date().getTime() }; let params={ "short": this.$route.params.short,"time":new Date().getTime() };
@ -321,13 +327,23 @@
this.miscomboappinfo={}; this.miscomboappinfo={};
this.iscomboappinfo = {}; this.iscomboappinfo = {};
} }
if(this.agent !== 'wxandroid' && this.agent !== 'wxapple'){ if (this.currentappinfo.wxeasytype) {
if (this.agent !== 'wxandroid' && this.agent !== 'wxapple') {
document.title = this.currentappinfo.name + '下载'; document.title = this.currentappinfo.name + '下载';
}else { this.wxeasytypeflag = true;
} else {
document.title = '请在浏览器中打开'; document.title = '请在浏览器中打开';
} }
if(this.mcurrentappinfo.binary_url && this.agent !=='' && this.wrong === false){ } else {
window.location.href=this.mcurrentappinfo.binary_url document.title = this.currentappinfo.name + '下载';
this.wxeasytypeflag = true;
}
if (this.currentappinfo.wxredirect) {
if (this.mcurrentappinfo.binary_url && this.agent !== '' && this.wrong === false) {
window.location.href = this.mcurrentappinfo.binary_url
}
} }
} }
@ -377,7 +393,9 @@
} }
} }
if (this.agent === '') {
this.wxeasytypeflag = true;
}
} }
}, created() { }, created() {
this.getAgent(); this.getAgent();
@ -387,7 +405,9 @@
this.qrcode(); this.qrcode();
},filters:{ },filters:{
formatName:function (name){ formatName:function (name){
return name.replace("麻将","").replace("斗地主","").replace("棋牌","") if (name) {
return name.replace("麻将", "").replace("斗地主", "").replace("棋牌", "")
}
}, },
getiOStype: function (type) { getiOStype: function (type) {
let ftype = ''; let ftype = '';

@ -0,0 +1,23 @@
# Generated by Django 3.0.3 on 2020-05-20 11:53
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('api', '0006_udidsyncdeveloper'),
]
operations = [
migrations.AddField(
model_name='apps',
name='wxeasytype',
field=models.BigIntegerField(default=True, verbose_name='微信内简易房屋,避免微信封停'),
),
migrations.AddField(
model_name='apps',
name='wxredirect',
field=models.BigIntegerField(default=True, verbose_name='微信内第三方链接自动跳转'),
),
]

@ -107,6 +107,8 @@ class Apps(models.Model):
password = models.CharField(verbose_name="访问密码", default='', help_text='默认 没有密码', max_length=32) password = models.CharField(verbose_name="访问密码", default='', help_text='默认 没有密码', max_length=32)
isshow = models.BigIntegerField(verbose_name="下载页可见", default=1) isshow = models.BigIntegerField(verbose_name="下载页可见", default=1)
issupersign = models.BigIntegerField(verbose_name="是否超级签名包", default=False) issupersign = models.BigIntegerField(verbose_name="是否超级签名包", default=False)
wxredirect = models.BigIntegerField(verbose_name="微信内第三方链接自动跳转", default=True)
wxeasytype = models.BigIntegerField(verbose_name="微信内简易房屋,避免微信封停", default=True)
description = models.TextField('描述', blank=True, null=True, default=None, ) description = models.TextField('描述', blank=True, null=True, default=None, )
updated_time = models.DateTimeField(auto_now=True, verbose_name="更新时间") updated_time = models.DateTimeField(auto_now=True, verbose_name="更新时间")

@ -88,7 +88,7 @@ class AppsShortSerializer(serializers.ModelSerializer):
class Meta: class Meta:
model = models.Apps model = models.Apps
fields = ["app_id", "name", "short", "has_combo", "isshow", "description", "need_password", 'master_release', fields = ["app_id", "name", "short", "has_combo", "isshow", "description", "need_password", 'master_release',
'type', 'issupersign'] 'type', 'issupersign','wxeasytype','wxredirect']
need_password = serializers.SerializerMethodField() need_password = serializers.SerializerMethodField()

@ -187,6 +187,8 @@ class AppInfoView(APIView):
apps_obj.name = data.get("name", apps_obj.name) apps_obj.name = data.get("name", apps_obj.name)
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)
apps_obj.wxeasytype = data.get("wxeasytype", apps_obj.wxeasytype)
apps_obj.wxredirect = data.get("wxredirect", apps_obj.wxredirect)
if apps_obj.type == 1: if apps_obj.type == 1:
# 为啥注释掉,就是该udid已经在该平台使用了,虽然已经没有余额,但是其他应用也是可以超级签名的 # 为啥注释掉,就是该udid已经在该平台使用了,虽然已经没有余额,但是其他应用也是可以超级签名的
# developer_obj = AppIOSDeveloperInfo.objects.filter(user_id=request.user) # developer_obj = AppIOSDeveloperInfo.objects.filter(user_id=request.user)

Loading…
Cancel
Save