Browse Source

points不得為空值

zooey 1 year ago
parent
commit
f07431bee7
1 changed files with 2 additions and 1 deletions
  1. 2 1
      app/api/users.py

+ 2 - 1
app/api/users.py

@@ -118,6 +118,7 @@ async def login(username: str = Form(default=''), password: str = Form(default='
     return_msg = {
         "access_token": access_token,
         "token_type": "bearer",
+        "domain":"ntcri.org",
     }
     return return_msg
     # if add_time_code:
@@ -153,7 +154,7 @@ async def add(username: str = Form(default=''), password: str = Form(default='')
         else:
             if password == re_password:
                 hashed_password = bcrypt.hashpw(password.encode('utf-8'), bcrypt.gensalt()).decode('utf-8')
-                u = await User.create(username=username, password=hashed_password, email=email,is_superuser=0,is_gmail=0,token='')
+                u = await User.create(username=username, password=hashed_password, email=email,is_superuser=0,is_gmail=0,token='',points=0)
                 if u:
                     message = '註冊成功'
                     subject = '註冊信'