super_signature
nineven 5 years ago
parent f588a860df
commit 0c61cd4398
  1. 21
      fir_client/src/components/FirDownload.vue
  2. 20
      fir_download/src/components/FirDownload.vue
  3. 7
      fir_ser/api/utils/storage/localApi.py
  4. 16
      fir_ser/api/views/download.py
  5. 22
      fir_ser/fir_ser/settings.py
  6. 6
      fir_ser/uwsgi.conf

@ -13,8 +13,8 @@
</div>
<div v-else>
<span class="pattern left"><img src="../assets/download_pattern_left.png"></span>
<span class="pattern right"><img src="../assets/download_pattern_right.png"></span>
<!-- <span class="pattern left"><img src="../assets/download_pattern_left.png"></span>-->
<!-- <span class="pattern right"><img src="../assets/download_pattern_right.png"></span>-->
</div>
<el-container class="out-container">
@ -265,7 +265,7 @@
return
}
if (this.agent === "android") {
if (this.agent === "android" || this.agent === "wxandroid") {
// iOS
if (data.data.type === 1) {
if (data.data.has_combo) {
@ -288,7 +288,7 @@
} else {
this.dchoice = true;
}
} else if (this.agent === "apple") {
} else if (this.agent === "apple" || this.agent === "wxapple") {
if (data.data.type === 0) {
if (data.data.has_combo) {
if (!params.release_id) {
@ -341,6 +341,8 @@
}, params)
},
getAgent() {
const ua = navigator.userAgent.toLowerCase();
const browser = {
versions: function () {
const u = navigator.userAgent;
@ -361,14 +363,15 @@
};
if (browser.versions.iPhone || browser.versions.iPad || browser.versions.ios) {//
//is_weixn();//
// alert('');
this.agent = 'apple';
if (ua.match(/MicroMessenger/i) == "micromessenger") {
this.agent = 'wxapple';
//
} else {
this.agent = 'apple';
}
}
if (browser.versions.android) {//
var ua = navigator.userAgent.toLowerCase();
if (ua.match(/MicroMessenger/i) == "micromessenger") {
// alert('');
this.agent = 'wxandroid';

@ -11,8 +11,8 @@
</div>
<div v-else>
<span class="pattern left"><img src="../assets/download_pattern_left.png"></span>
<span class="pattern right"><img src="../assets/download_pattern_right.png"></span>
<!-- <span class="pattern left"><img src="../assets/download_pattern_left.png"></span>-->
<!-- <span class="pattern right"><img src="../assets/download_pattern_right.png"></span>-->
</div>
<div class="out-container container">
@ -251,7 +251,7 @@
return false
}
if(this.agent === "android"){
if(this.agent === "android" || this.agent === "wxandroid"){
// iOS
if(data.data.type === 1){
if(data.data.has_combo){
@ -274,7 +274,7 @@
}else {
this.dchoice=true;
}
}else if(this.agent === "apple"){
}else if(this.agent === "apple"|| this.agent === "wxapple"){
if(data.data.type === 0){
if(data.data.has_combo){
if(!params.release_id){
@ -325,6 +325,7 @@
}, params)
},
getAgent() {
const ua = navigator.userAgent.toLowerCase();
const browser = {
versions: function () {
const u = navigator.userAgent;
@ -345,14 +346,15 @@
};
if (browser.versions.iPhone || browser.versions.iPad || browser.versions.ios) {//
//is_weixn();//
// alert('');
this.agent = 'apple';
if (ua.match(/MicroMessenger/i) == "micromessenger") {
this.agent = 'wxapple';
//
} else {
this.agent = 'apple';
}
}
if (browser.versions.android) {//
var ua = navigator.userAgent.toLowerCase();
if (ua.match(/MicroMessenger/i) == "micromessenger") {
// alert('');
this.agent = 'wxandroid';

@ -26,8 +26,11 @@ class LocalStorage(object):
uri = 'http://'
if self.is_https:
uri = 'https://'
download_url = "%s%s?%s=%s" % (
uri, base_url, settings.DATA_DOWNLOAD_KEY, dtoken.make_token(name, expires, force_new=force_new))
if settings.DATA_DOWNLOAD_KEY_OPEN:
download_url = "%s%s?%s=%s" % (
uri, base_url, settings.DATA_DOWNLOAD_KEY, dtoken.make_token(name, expires, force_new=force_new))
else:
download_url = "%s%s" % (uri, base_url)
return download_url
def del_file(self, name):

@ -33,13 +33,17 @@ class DownloadView(APIView):
res = BaseResponse()
downtoken = request.query_params.get(settings.DATA_DOWNLOAD_KEY, None)
ftype = filename.split(".")[-1]
if not downtoken:
res.code = 1004
res.msg = "缺失token"
return Response(res.dict)
flag=True
if settings.DATA_DOWNLOAD_KEY_OPEN:
if not downtoken:
res.code = 1004
res.msg = "缺失token"
return Response(res.dict)
dtoken = DownloadToken()
if dtoken.verify_token(downtoken, filename):
dtoken = DownloadToken()
flag=dtoken.verify_token(downtoken, filename)
if flag:
if ftype == 'plist':
release_id = filename.split('.')[0]
apptodev_obj = APPToDeveloper.objects.filter(binary_file=release_id).first()

@ -88,7 +88,8 @@ DATABASES = {
'HOST': '127.0.0.1',
'PORT': '3306',
# 设置MySQL的驱动
'OPTIONS': {'init_command': 'SET storage_engine=INNODB'}
# 'OPTIONS': {'init_command': 'SET storage_engine=INNODB'},
'OPTIONS': {'init_command': 'SET sql_mode="STRICT_TRANS_TABLES"','charset': 'utf8mb4'}
}
}
@ -199,13 +200,13 @@ THIRD_PART_CONFIG = {
'name': 'aliyun',
'type': 2,
'auth': {
'access_key': 'LTAI4FkbTRqejBAzB1yQZpjR',
'secret_key': '2WzCsKjYXxOvU4wPtTmrrXnxiLIxy9',
'bucket_name': 'fly-app-storage',
'sts_role_arn': 'acs:ram::1886562303345632:role/fly-app-storage',
'access_key': 'LTAI4FkbTR',
'secret_key': '2iLIxy9',
'bucket_name': 'fge',
'sts_role_arn': 'ap-sage',
'endpoint': 'oss-cn-beijing.aliyuncs.com',
'is_https': True,
'domain_name': 'ali.storage.dvcloud.xin'
'domain_name': 'aoud.xin'
},
'active': False
},
@ -213,11 +214,11 @@ THIRD_PART_CONFIG = {
'name': 'qiniuyun',
'type': 1,
'auth': {
'access_key': 'mTqfvkLVSTVb2_1ERjDlFS_WAHLSkpDxYr4e4fiJ',
'secret_key': '0G9fXfgmi8h1-bmEsABYkE6apf8IuwKpj3hYLynv',
'bucket_name': 'fir-storage',
'access_key': 'mT4fiJ',
'secret_key': '0G9fXfhYLynv',
'bucket_name': 'fge',
'is_https': False,
'domain_name': 'fly-cdn.dvcloud.xin'
'domain_name': 'foud.xin'
},
'active': False
}
@ -237,6 +238,7 @@ CACHE_KEY_TEMPLATE = {
}
DATA_DOWNLOAD_KEY="d_token"
DATA_DOWNLOAD_KEY_OPEN=True #是否开启图片和应用下载token,只本地存储支持该操作
SYNC_CACHE_TO_DATABASE = {
'download_times': 10 # 下载次数同步时间

@ -6,7 +6,7 @@
socket = 127.0.0.1:8899
# the base directory (full path) django 程序的主目录
chdir = /www/fir_ser
chdir = ./
# Django's wsgi file
wsgi-file = fir_ser/wsgi.py
@ -23,6 +23,8 @@ threads = 4
#monitor uwsgi status 通过该端口可以监控 uwsgi 的负载情况
stats = 127.0.0.1:9191
uid=nginx
gid=nginx
# clear environment on exit
vacuum = true
@ -30,4 +32,4 @@ vacuum = true
enable-threads = true
# 后台运行,并输出日志
daemonize = /var/log/uwsgi.log
daemonize = ./flyapp.log

Loading…
Cancel
Save