兼容老API接口

publicsignpoll
fxC 3 years ago
parent f30aafb5d9
commit 5be7115e91
  1. 4
      fir_client/src/components/FirDownload.vue
  2. 6
      fir_client/src/components/ShortDownload.vue
  3. 4
      fir_ser/api/migrations/0024_auto_20211108_1755.py
  4. 2
      fir_ser/api/utils/baseutils.py
  5. 1
      fir_ser/api/utils/utils.py
  6. 4
      fir_ser/api/views/download.py
  7. 3
      fir_ser/api/views/login.py

@ -709,6 +709,10 @@ export default {
} }
getShortAppinfo(data => { getShortAppinfo(data => {
if (data.code === 1000) { if (data.code === 1000) {
if (data.redirect && data.data) {
window.location.href = data.data;
return
}
if (data.ad && data.ad.ad_uri) { if (data.ad && data.ad.ad_uri) {
this.ad_info = data.ad; this.ad_info = data.ad;
} }

@ -671,6 +671,10 @@ export default {
} }
getShortAppinfo(data => { getShortAppinfo(data => {
if (data.code === 1000) { if (data.code === 1000) {
if (data.redirect && data.data) {
window.location.href = data.data;
return
}
if (data.ad && data.ad.ad_uri) { if (data.ad && data.ad.ad_uri) {
this.ad_info = data.ad; this.ad_info = data.ad;
} }
@ -804,7 +808,7 @@ export default {
trident: u.indexOf('Trident') > -1, //IE trident: u.indexOf('Trident') > -1, //IE
presto: u.indexOf('Presto') > -1, //opera presto: u.indexOf('Presto') > -1, //opera
webKit: u.indexOf('AppleWebKit') > -1, // webKit: u.indexOf('AppleWebKit') > -1, //
gecko: u.indexOf('Gecko') > -1 && u.indexOf('KHTML') == -1, // gecko: u.indexOf('Gecko') > -1 && u.indexOf('KHTML') === -1, //
mobile: !!u.match(/AppleWebKit.*Mobile/i) || !!u.match(/MIDP|SymbianOS|NOKIA|SAMSUNG|LG|NEC|TCL|Alcatel|BIRD|DBTEL|Dopod|PHILIPS|HAIER|LENOVO|MOT-|Nokia|SonyEricsson|SIE-|Amoi|ZTE/), // mobile: !!u.match(/AppleWebKit.*Mobile/i) || !!u.match(/MIDP|SymbianOS|NOKIA|SAMSUNG|LG|NEC|TCL|Alcatel|BIRD|DBTEL|Dopod|PHILIPS|HAIER|LENOVO|MOT-|Nokia|SonyEricsson|SIE-|Amoi|ZTE/), //
ios: !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/), //ios ios: !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/), //ios
android: u.indexOf('Android') > -1 || u.indexOf('Linux') > -1, //androiduc android: u.indexOf('Android') > -1 || u.indexOf('Linux') > -1, //androiduc

@ -4,7 +4,6 @@ from django.db import migrations, models
class Migration(migrations.Migration): class Migration(migrations.Migration):
dependencies = [ dependencies = [
('api', '0023_remove_appudid_binary_file'), ('api', '0023_remove_appudid_binary_file'),
] ]
@ -18,6 +17,7 @@ class Migration(migrations.Migration):
migrations.AlterField( migrations.AlterField(
model_name='order', model_name='order',
name='order_type', name='order_type',
field=models.SmallIntegerField(choices=[(0, '用户下单'), (1, '后台充值'), (2, '系统赠送')], default=0, verbose_name='订单类型'), field=models.SmallIntegerField(choices=[(0, '用户下单'), (1, '后台充值'), (2, '系统赠送')], default=0,
verbose_name='订单类型'),
), ),
] ]

@ -9,10 +9,10 @@ import datetime
import hashlib import hashlib
import logging import logging
import os import os
import random
import re import re
import time import time
import uuid import uuid
import random
from Crypto import Random from Crypto import Random
from Crypto.Cipher import AES from Crypto.Cipher import AES

@ -7,7 +7,6 @@ import binascii
import datetime import datetime
import logging import logging
import os import os
import random
from captcha.helpers import captcha_image_url from captcha.helpers import captcha_image_url
from captcha.models import CaptchaStore from captcha.models import CaptchaStore

@ -157,7 +157,9 @@ class ShortDownloadView(APIView):
domain_name = get_redirect_server_domain(request, user_obj, get_app_domain_name(app_obj)) domain_name = get_redirect_server_domain(request, user_obj, get_app_domain_name(app_obj))
origin_domain_name = get_origin_domain_name(request) origin_domain_name = get_origin_domain_name(request)
if domain_name.split('//')[-1].split('/')[0] != origin_domain_name: if domain_name.split('//')[-1].split('/')[0] != origin_domain_name:
res.code = 302 res.code = 1000
res.domain_name = domain_name
res.redirect = True
res.data = format_get_uri(domain_name, short, {'release_id': release_id, 'udid': udid}) res.data = format_get_uri(domain_name, short, {'release_id': release_id, 'udid': udid})
return Response(res.dict) return Response(res.dict)

@ -1,11 +1,10 @@
import logging import logging
from django.contrib import auth from django.contrib import auth
from django.core.cache import cache
from rest_framework.response import Response from rest_framework.response import Response
from rest_framework.views import APIView from rest_framework.views import APIView
from api.models import Token, UserInfo, UserCertificationInfo, CertificationInfo, Apps from api.models import UserInfo, UserCertificationInfo, CertificationInfo, Apps
from api.utils.auth import ExpiringTokenAuthentication from api.utils.auth import ExpiringTokenAuthentication
from api.utils.baseutils import is_valid_phone, is_valid_email, get_real_ip_address from api.utils.baseutils import is_valid_phone, is_valid_email, get_real_ip_address
from api.utils.geetest.geetest_utils import first_register, second_validate from api.utils.geetest.geetest_utils import first_register, second_validate

Loading…
Cancel
Save