Эх сурвалжийг харах

修复小程序获取手机号存在问题

locky 7 сар өмнө
parent
commit
43244d1328

+ 3 - 3
Controller/WeChatMiniProgram/UserController.py

@@ -123,13 +123,13 @@ class UserView(View):
             data = {
                 'code': code
             }
-            r = requests.post(url=url, data=data, timeout=5)
+            r = requests.post(url=url, json=data, timeout=5)
             result = eval(r.content)
             errcode = result.get('errcode')
             assert errcode == 0
-            pure_phone_number = result['phone_info']['purePhoneNumber']
+            phone_number = result['phone_info']['purePhoneNumber']
             res = {
-                'pure_phone_number': pure_phone_number
+                'phone_number': phone_number
             }
             return response.json(0, res)
         except Exception as e: