Prechádzať zdrojové kódy

解决苹果绑定接口异常

tanghongbin 4 rokov pred
rodič
commit
3377c2bd81
1 zmenil súbory, kde vykonal 4 pridanie a 1 odobranie
  1. 4 1
      Controller/UserController.py

+ 4 - 1
Controller/UserController.py

@@ -3371,7 +3371,10 @@ class AppleAuthLogin(View):
                     else:
                         # 如果用户为绑定过则创建用户并进行登录返回token
                         userID = CommonService.getUserID(getUser=False)
-                        nickname = claims['email']
+                        if claims.__contains__('email'):
+                            nickname = claims['email']
+                        else:
+                            nickname = 'apple_{num}'.format(num=CommonService.RandomStr(6, False))
                         return self.do_register(userID, nickname, response, app_bundle_id, unionID)
 
                 except Exception as e: