d class="lines-num lines-num-old"> 23
+    latest_app = get_latest_app(src)
22 24
 
23 25
     if request.iOS:
24 26
         appinfo = {
@@ -45,7 +47,9 @@ def splash_api(request):
45 47
     :param request:
46 48
     :return:
47 49
     """
48
-    splashes = SplashInfo.objects.all()
50
+    src = int(request.POST.get('src', 0))
51
+
52
+    splashes = SplashInfo.objects.filter(src=src, status=True)
49 53
     splashes = [splash.data for splash in splashes]
50 54
 
51 55
     return response(200, 'Get Splash Success', u'获取最新版信息成功', {

+ 5 - 5
utils/redis/rapp.py

@@ -14,16 +14,16 @@ r = settings.REDIS_CACHE
14 14
 # 最新 APP 相关
15 15
 
16 16
 
17
-def set_latest_app():
17
+def set_latest_app(src=0):
18 18
     """ 设置最新 APP 信息 """
19 19
     try:
20
-        appinfo = LatestAppInfo.objects.all()[0].data
20
+        appinfo = LatestAppInfo.objects.filter(src=src)[0].data
21 21
     except IndexError:
22 22
         appinfo = {}
23
-    r.set(LATEST_APP_INFO, json.dumps(appinfo))
23
+    r.set(LATEST_APP_INFO % src, json.dumps(appinfo))
24 24
     return appinfo
25 25
 
26 26
 
27
-def get_latest_app():
27
+def get_latest_app(src=0):
28 28
     """ 获取最新 APP 信息 """
29
-    return json.loads(r.get(LATEST_APP_INFO) or '{}') or set_latest_app()
29
+    return json.loads(r.get(LATEST_APP_INFO % src) or '{}') or set_latest_app(src)

+ 1 - 1
utils/redis/rkeys.py

@@ -48,4 +48,4 @@ SYSTEM_MESSAGE_DELETED_INFO = 'system:message:deleted:info:%s'  # STRING,系
48 48
 GUEST_ENTRANCE_CONTROL_INFO = 'guest:entrance:control:info'  # STRING,游客入口控制信息
49 49
 
50 50
 # APP 相关
51
-LATEST_APP_INFO = 'latest:app:info'  # STRING,最新 APP 信息
51
+LATEST_APP_INFO = 'latest:app:info:%s'  # STRING,最新 APP 信息,src

Kodo/kodo - Gogs: Go Git Service

8 Commits (dc68e58981d4a00990aa2ab1cbe9ac24a31201b6)

Author SHA1 Message Date
  huangqimin001 405d666c64 :art: Make thumbnail for image upload 1 year ago
  huangqimin001 3f6a048122 :art: Opt quant_data ndeep for 3 times 2 years ago
  huangqimin001 899ea80e16 :art: Support pngquant 2 years ago
  huangqimin001 6472cab908 :art: Support QINIU_FILE_URL_BEFORE / QINIU_FILE_URL_AFTER 3 years ago
  huangqimin001 431660d0f7 :art: Support file directly upload qiniu 3 years ago
  huangqimin 4ce7f5c87b :art: Member Relative APIs 6 years ago
  Brightcells ac03876ce1 qiniu_file_url 9 years ago
  Brightcells e38c2defaf Upload photo to qiniu 9 years ago