debug url

This commit is contained in:
hackrobot
2024-03-25 11:09:09 +08:00
parent d363c656de
commit 8f49a28dab
2 changed files with 2 additions and 2 deletions

Binary file not shown.

View File

@@ -60,11 +60,11 @@ def read_users(code, wxid, db: Session = Depends(get_db)):
'js_code': code,
'grant_type': 'authorization_code'
}
res = requests.get(url=config.tokenUrl, params=payload)
res = requests.get('https://api.weixin.qq.com/sns/jscode2sessio', params=payload)
r = res.json()
# 返回参数 session_key/unionid/errmsg/openid/errcode
print('r----', r)
openId = r['openId']
openId = r['openid']
print('openId----', openId)
db_user = crud.get_user_by_openId(db, openId=openId)
print('db_user----', db_user)