Browse Source

每天定时统计脚本

tanghongbin 5 năm trước cách đây
mục cha
commit
874c21c807
1 tập tin đã thay đổi với 29 bổ sung0 xóa
  1. 29 0
      Ansjer/statistics_push_day_task.py

+ 29 - 0
Ansjer/statistics_push_day_task.py

@@ -0,0 +1,29 @@
+import json
+
+import requests
+
+
+# url = 'http://test.dvema.com'
+base_url = 'http://test.dvema.com/'
+# username='13800138001'
+# password='ansjer123456'
+
+login_url = base_url + 'account/login'
+username='13798991771'
+password='123456'
+data = {
+    'userName': username,
+    'userPwd': password
+}
+res = requests.post(url=login_url, data=data)
+res = res.json()
+print(res)
+
+if res['result_code'] == 0:
+    statistics_url = base_url + 'statistcs/pushDay'
+    data = {
+        'token': res['result']['access_token']
+    }
+    res = requests.post(url=statistics_url, data=data)
+    print(res.json())
+