言成言成啊 | Kit Chen's Blog

今日校园实现自动监测并提交最新签到

站在巨人的肩膀上,所以该代码全部开源,我也借鉴的大佬的东西,放在第三节致谢。有问题可以在下面进行留言讨论!

源码

博客地址

一、开发流程

1.1 思路

  1. 抓包(抓包的流程,可以参照我之前的文章
  2. 每日接口获取最新表单
  3. 通过上步的id获取详细表单
  4. 通过上步获取该表单的选项id

如果整体的思路看不明白,可以参照下面的详细步骤

2.1 获取最新表单

接口

1
/wec-counselor-sign-apps/stu/sign/getStuSignInfosInOneDay

参数

1
{}

返回值

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
67
68
{
"code": "0",
"message": "SUCCESS",
"datas": {
"dayInMonth": "2020-09-10",
"codeRcvdTasks": [],
"signedTasks": [],
"unSignedTasks": [{
"stuSignWid": "746210",
"signInstanceWid": "4146", //需要
"signWid": "514213", //需要
"signRate": "1",
"taskType": "4",
"taskName": "一日三签(早签到)",
"senderUserName": "牛逼学院(牛逼老师)",
"signStatus": "2",
"isMalposition": null,
"isLeave": "0",
"leavePcUrl": null,
"leaveMobileUrl": null,
"currentTime": "2020-09-10 08:15",
"singleTaskBeginTime": null,
"singleTaskEndTime": null,
"rateSignDate": "2020-09-10 (周四)",
"rateTaskBeginTime": "05:00",
"rateTaskEndTime": "09:59"
}, {
"stuSignWid": "759720",
"signInstanceWid": "4199",
"signWid": "514234",
"signRate": "1",
"taskType": "4",
"taskName": "一日三签(午签到)",
"senderUserName": "牛逼学院(牛逼老师)",
"signStatus": "2",
"isMalposition": null,
"isLeave": "0",
"leavePcUrl": null,
"leaveMobileUrl": null,
"currentTime": "2020-09-10 08:15",
"singleTaskBeginTime": null,
"singleTaskEndTime": null,
"rateSignDate": "2020-09-10 (周四)",
"rateTaskBeginTime": "10:00",
"rateTaskEndTime": "15:59"
}, {
"stuSignWid": "778325",
"signInstanceWid": "4266",
"signWid": "535128",
"signRate": "1",
"taskType": "4",
"taskName": "一日三签(晚签到)",
"senderUserName": "牛逼学院(牛逼老师)",
"signStatus": "2",
"isMalposition": null,
"isLeave": "0",
"leavePcUrl": null,
"leaveMobileUrl": null,
"currentTime": "2020-09-10 08:15",
"singleTaskBeginTime": null,
"singleTaskEndTime": null,
"rateSignDate": "2020-09-10 (周四)",
"rateTaskBeginTime": "16:00",
"rateTaskEndTime": "22:00"
}],
"leaveTasks": []
}
}

其中我们需要获取signWid514213和signInstanceWid4146

2.2 获取详细信息

接口

1
/wec-counselor-sign-apps/stu/sign/detailSignInstance

参数

1
2
3
4
{
"signWid" : 514213,
"signInstanceWid" : 4146
}

返回值

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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
{
"message" : "SUCCESS",
"datas" : {
"latitude" : "",
"singleTaskEndTime" : null,
"catQrUrl" : "https:\/\/cat.cpdaily.com\/erweima",
"singleTaskBeginTime" : null,
"signInstanceWid" : "4146",
"signPhotoUrl" : null,
"signTime" : null,
"senderUserName" : "牛逼学院(牛逼老师)",
"qrCodeRcvdUsers" : [
{
"targetWid" : "91457111",
"targetType" : "4",
"targetName" : "牛逼老师\/19070302",
"targetGrade" : "-1",
"targetDegree" : "-1",
"targetUserType" : "-1"
}
],
"isNeedExtra" : 1,
"signCondition" : 0,
"currentTime" : "2020-09-10 09:33:08",
"taskDesc" : "https:\/\/wecres.cpdaily.com\/counselor\/1018615876819107\/content\/54e503639d0244049c3b85baabe509fc.html",
"signType" : null,
"changeActorName" : "牛逼老师",
"isMalposition" : 0,
"longitude" : "",
"signedStuInfo" : {
"cls" : "20200521",
"major" : "改变世界专业-牛逼",
"dept" : "牛逼学院",
"sex" : "男",
"mobile" : null,
"nation" : "-",
"userWid" : "1017790009",
"userId" : "20200521",
"userName" : "雷军",
"malposition" : null,
"extraFieldItemVos" : [
{
"fieldIndex" : 0,
"extraDesc" : "",
"extraFieldItemWid" : "",
"extraTitle" : "体温",
"extraFieldItem" : null,
"isExtraFieldOtherItem" : "0",
"isAbnormal" : "0"
},
{
"fieldIndex" : 0,
"extraDesc" : "",
"extraFieldItemWid" : "",
"extraTitle" : "身体是否异常",
"extraFieldItem" : null,
"isExtraFieldOtherItem" : "0",
"isAbnormal" : "0"
}
],
"schoolStatus" : null,
"stuDormitoryVo" : {
"sex" : "",
"area" : "",
"building" : "",
"unit" : "",
"room" : ""
},
"grade" : "2019级"
},
"extraFieldItemVos" : [

],
"changeTime" : null,
"taskType" : "4",
"photograph" : [

],
"signRate" : "1",
"isPhoto" : 0,
"signAddress" : null,
"rateTaskEndTime" : "09:59",
"taskName" : "一日三签(早签到)",
"leaveAppUrl" : "\/wec-counselor-leave-apps\/leave\/home\/index.html",
"isAllowUpdate" : false,
"signMode" : 0,
"rateTaskBeginTime" : "05:00",
"signStatus" : "2",
"signPlaceSelected" : [
{
"address" : "只有野鸡学校才用这个流氓app(北界王西区)",
"radius" : 520,
"longitude" : "125.398185",
"placeWid" : null,
"creatorUserWid" : null,
"creatorName" : null,
"wid" : null,
"latitude" : "44.001709",
"currentStatus" : null,
"isShare" : null,
"creatorUserId" : null
},
{
"address" : "只有野鸡学校才用这个流氓app(北界王东区)",
"radius" : 500,
"longitude" : "125.40993457956229",
"placeWid" : null,
"creatorUserWid" : null,
"creatorName" : null,
"wid" : null,
"latitude" : "44.00262969203334",
"currentStatus" : null,
"isShare" : null,
"creatorUserId" : null
},
{
"address" : "只有野鸡学校才用这个流氓app(南界王校区)",
"radius" : 400,
"longitude" : "125.296568",
"placeWid" : null,
"creatorUserWid" : null,
"creatorName" : null,
"wid" : null,
"latitude" : "43.859918",
"currentStatus" : null,
"isShare" : null,
"creatorUserId" : null
}
],
"rateSignDate" : "2020-09-10 (周四)",
"extraField" : [
{
"hasOtherItems" : 0,
"title" : "体温",
"extraFieldItems" : [
{
"isSelected" : null,
"value" : null,
"content" : "37.3度以下",
"isOtherItems" : 0,
"wid" : 499882,//获取
"isAbnormal" : false
},
{
"isSelected" : null,
"value" : null,
"content" : "37.3度及以上",
"isOtherItems" : 0,
"wid" : 499883,
"isAbnormal" : true
}
],
"description" : "",
"wid" : 211814
},
{
"hasOtherItems" : 1,
"title" : "身体是否异常",
"extraFieldItems" : [
{
"isSelected" : null,
"value" : null,
"content" : "健康",
"isOtherItems" : 0,
"wid" : 499884,//获取
"isAbnormal" : false
},
{
"isSelected" : null,
"value" : null,
"content" : "感冒",
"isOtherItems" : 0,
"wid" : 499885,
"isAbnormal" : false
},
{
"isSelected" : null,
"value" : null,
"content" : "发烧",
"isOtherItems" : 0,
"wid" : 499886,
"isAbnormal" : false
},
{
"isSelected" : null,
"value" : null,
"content" : "咳嗽",
"isOtherItems" : 0,
"wid" : 499887,
"isAbnormal" : false
},
{
"isSelected" : null,
"value" : null,
"content" : "其它",
"isOtherItems" : 1,
"wid" : 499888,
"isAbnormal" : false
}
],
"description" : "",
"wid" : 211815
}
],
"downloadUrl" : "https:\/\/img.cpdaily.com\/ldy\/index.html"
},
"code" : "0"
}

获取我需要的两个参数,体温选项499882和身体是否异常选项499884

2.3 模拟提交

最后通过上面步骤获取到的4146,499882,499884以及自定义的地址,进行签到

接口

1
/wec-counselor-sign-apps/stu/sign/submitSign

参数

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
{
"abnormalReason": "",
"position": "你的地址",
"longitude": 你的经度,
"isNeedExtra": 1,
"latitude": 你的纬度,
"isMalposition": 0,
"extraFieldItems": [{
"extraFieldItemWid": 499882,
"extraFieldItemValue": "37.3度以下"
},
{
"extraFieldItemWid": 499884,
"extraFieldItemValue": "健康"
}
],
"signInstanceWid": "4146",
"signPhotoUrl": ""
}

返回值

1
2
3
4
5
6
7
8
{
"message" : "SUCCESS",
"datas" : {
"signedStuInfo" : null,
"signInstanceWid" : "4146"
},
"code" : "0"
}

二、运行结果

三、致谢

  1. ZimoLoveShuang
发布:2020-09-10 09:12:07
修改:2020-09-10 18:26:33
链接:https://meethigher.top/blog/2020/cpdaily-sign/
标签:java open 
付款码 捐助 分享
翻墙之后才能评论哦
阅读量