某朴超市利用flask在线获取refreshtoken

Dingdong

朴朴的微信开发ID为wx86233b2f41212f34,bundleID为com.pupumall.customer,通过构建Url

https://open.weixin.qq.com/connect/app/qrconnect?appid=&bundleid=&scope=snsapi_base%2Csnsapi_userinfo%2Csnsapi_friend%2Csnsapi_message&state=weixin

从response中匹配到uuid,将二维码地址返回给前端

https://open.weixin.qq.com/connect/qrcode/{uuid}

扫码后,前端点击按钮触发下一步骤
通过uuid辨别用户
后端再进行访问

https://long.open.weixin.qq.com/connect/l/qrconnect?uuid={uuid}&f=url

如果状态码为200再进行正则匹配'window.wx_errcode=(.*?);', res.text)[0],如果返回值为405就再次进行匹配code'\?code=(.*?)&state=', res.text)[0]
将匹配到的结果构建Json

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
jsondata = {
"code": code,
"location": {},
"user_device": {
"device_os": "20",
"client_id": "",
"mac_address": "",
"black_box": "",
"device_token": "",
"app_version": "30807",
"device_id": "",
"push_channel": "60",
"device_model": "iPad11,1"
}
}

某朴的登录api为https://cauth.pupuapi.com/clientauth/user/society/wechat/login?user_society_type=11
Post请求后将结果返回给前端
前端自行提取refresh_token字段

  • Title: 某朴超市利用flask在线获取refreshtoken
  • Author: Dingdong
  • Created at : 2024-07-22 03:14:26
  • Updated at : 2024-07-23 14:45:42
  • Link: https://www.dp0.cc/2024/07/22/某朴超市利用flask在线获取refreshtoken/
  • License: This work is licensed under CC BY-NC-SA 4.0.
On this page
某朴超市利用flask在线获取refreshtoken