-
Notifications
You must be signed in to change notification settings - Fork 0
/
nango_test.py
66 lines (53 loc) · 2.26 KB
/
nango_test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
__author__ = 'luo.mingnan'
import urllib
import urllib2
import json
#1.9 password_change
def userPasswordChange(mobile, old_password, new_password):
data = {'mobile': mobile, 'old_password': old_password, 'new_password': new_password}
data = urllib.urlencode(data)
req = urllib2.Request(url="http://localhost:8080/user/password/change", data=data)
return urllib2.urlopen(req).read()
# response=userPasswordChange("18819410001","100001","100001")
# print response
#1.10 password/forget
def userPasswordForget(mobile):
data = {'mobile': mobile}
data = urllib.urlencode(data)
req = urllib2.Request(url="http://localhost:8080/user/password/forget", data=data)
return urllib2.urlopen(req).read()
# response=userPasswordForget("18819410000")
# print response
#1.11 password_change
def userVerifyPasswordChange(mobile, verify_code, new_password):
data = {'mobile': mobile, 'verify_code': verify_code, 'new_password': new_password}
data = urllib.urlencode(data)
req = urllib2.Request(url="http://localhost:8080/user/password/verify", data=data)
return urllib2.urlopen(req).read()
# response=userVerifyPasswordChange("18819410000","10000","100000")
# print response
#1.12---------------------?????????????
#4.1 campus/login
def campusLogin(login_name,password):
data = {'login_name': login_name, 'password': password}
data = urllib.urlencode(data)
req = urllib2.Request(url="http://localhost:8080/campus/login", data=data)
return urllib2.urlopen(req).read()
# response=campusLogin("admin1","admin")#db340f93d690a9840df85c24b64d767f
# print response
#4.2 campus/logout
def campusLogout(access_token):
data = {'access_token': access_token}
data = urllib.urlencode(data)
req = urllib2.Request(url="http://localhost:8080/campus/logout", data=data)
return urllib2.urlopen(req).read()
# response = campusLogout("")
# print response
#10.5 /user/post/comment/list
def userPostCommentList(access_token=None, user_id=None, post_id=None):
data = {'access_token': access_token,'user_id':user_id,'post_id':post_id}
data = urllib.urlencode(data)
req = urllib2.Request(url="http://localhost:8080/user/post/comment/list", data=data)
return urllib2.urlopen(req).read()
response = userPostCommentList("123456",2,1)
print response