浏览代码

修改代码 - 修复同一手机 不同用户登录的内购问题

linhaohong 1 年之前
父节点
当前提交
967e505b36
共有 1 个文件被更改,包括 11 次插入10 次删除
  1. 11 10
      Controller/InAppPurchaseController.py

+ 11 - 10
Controller/InAppPurchaseController.py

@@ -109,16 +109,17 @@ class InAppPurchaseView(View):
                 return response.json(10048)
 
             # 处理一台手机多账号登录订阅情况
-            device_apple_package_qs = DeviceApplePackage.objects.filter(
-                original_transaction_id=original_transaction_identifier)
-            if device_apple_package_qs.exists():
-                if device_apple_package_qs[0]["userID"] != user_id:
-                    return response.json(10050)
-                elif device_apple_package_qs[0]["uid"] == uid:
-                    device_apple_package_qs.update(subscription_status=1)
-                    return response.json(0)
-                else:
-                    return response.json(10048)
+            if original_transaction_identifier != "":
+                device_apple_package_qs = DeviceApplePackage.objects.filter(
+                    original_transaction_id=original_transaction_identifier)
+                if device_apple_package_qs.exists():
+                    if device_apple_package_qs[0]["userID"] != user_id:
+                        return response.json(10050)
+                    elif device_apple_package_qs[0]["uid"] == uid:
+                        device_apple_package_qs.update(subscription_status=1)
+                        return response.json(0)
+                    else:
+                        return response.json(10048)
 
             root_certificates = []
             for cert_name in [