|
@@ -65,25 +65,28 @@ class AppSetView(View):
|
|
|
key_id= "www"+appBundleId
|
|
|
else:
|
|
|
key_id = "test" + appBundleId
|
|
|
- redis_value = redis.get_data(key=key_id)
|
|
|
+ redis_value = False
|
|
|
if redis_value == False:
|
|
|
print('添加到缓存')
|
|
|
# 查数据库
|
|
|
sm_qs = AppSetModel.objects.filter(appBundleId=appBundleId)
|
|
|
count = sm_qs.count()
|
|
|
if count > 0:
|
|
|
- if sm_qs[0]['editionUpgrading']:
|
|
|
- if lang !='cn':
|
|
|
- sm_qs[0]['editionUpgrading'] = 'Upgrading, please sign in later'
|
|
|
- else:
|
|
|
- sm_qs[0]['editionUpgrading'] = '正在升级,请稍后登录'
|
|
|
|
|
|
sm_qs = sm_qs.values("content")
|
|
|
# 添加到缓存,缓存时间为3600秒------指的是一个钟后再次访问,就会刷新缓存一次
|
|
|
- content_json_str = list(sm_qs)[0]['content'].replace("'", '"')
|
|
|
+ dict_json = json.loads(sm_qs[0]['content'])
|
|
|
+ if 'editionUpgrading' in dict_json and dict_json['editionUpgrading'] == 1:
|
|
|
+ if lang !='cn':
|
|
|
+ dict_json['editionUpgrading'] = 'Upgrading, please sign in later'
|
|
|
+ else:
|
|
|
+ dict_json['editionUpgrading'] = '正在升级,请稍后登录'
|
|
|
+
|
|
|
+ content_json_str = dict_json
|
|
|
+
|
|
|
redis.set_data(key=key_id, val=content_json_str, expire=3600)
|
|
|
# 返回固定值
|
|
|
- return response.json(0, json.loads(list(sm_qs)[0]['content']))
|
|
|
+ return response.json(0, content_json_str)
|
|
|
else:
|
|
|
return response.json(173)
|
|
|
else:
|