浏览代码

查询版本记录不为中英文默认返回英文

locky 3 月之前
父节点
当前提交
f5c04a201c
共有 1 个文件被更改,包括 5 次插入5 次删除
  1. 5 5
      Controller/AppInfo.py

+ 5 - 5
Controller/AppInfo.py

@@ -273,11 +273,11 @@ class AppVersionView(View):
         appBundleId = request_dict.get('appBundleId', None)
         app_type = request_dict.get('app_type', None)
         lang = request_dict.get('lang', None)
-        # print (appBundleId)
-        # if lang == 'cn':
-        #     return render('appVersionLists_cn.html')
-        # else:
-        #     return render('appVersionLists_en.html')
+
+        # 不为中英文默认返回英文
+        if lang not in ['cn', 'en']:
+            lang = 'en'
+
         queryset = App_Colophon.objects.filter(lang=lang, app_id__appBundleId=appBundleId,
                                                app_id__app_type=app_type).order_by('-version_time', '-newApp_version')
         queryset_dict = CommonService.qs_to_dict(queryset).get('datas')