Browse Source

修改地三方登入

zooey 1 năm trước cách đây
mục cha
commit
7bcdbaa6ed
1 tập tin đã thay đổi với 5 bổ sung6 xóa
  1. 5 6
      app/api/users.py

+ 5 - 6
app/api/users.py

@@ -93,10 +93,11 @@ async def login(username: str = Form(default=''), password: str = Form(default='
     """
 
     user = await User.filter(email=email,is_gmail=1).first() # 確認信箱是否已存在
-    if user:
-        if user.is_gmail==0:
-            print('已用相同信箱註冊過,再開一個GMAIL帳號')
-            u = await User.create(username=username, password=password,email=email,is_gmail=1)
+    if not user:
+        u = await User.create(username=username, password=password, email=email, is_gmail=1)
+    # if user:
+    #     print('已用相同信箱註冊過,再開一個GMAIL帳號')
+    #     u = await User.create(username=username, password=password,email=email,is_gmail=1)
 
     access_token = manager.create_access_token(
         data={'sub': username}
@@ -298,8 +299,6 @@ async def delete(id: int):
 
     return {"msg": "failed", "code": 400}
 
-print('12334')
-
 
 @users.get("/information")
 async def get_information(email:str,is_gmail:int):