Skip to content

Commit

Permalink
班级&教师课表超时时间&班级课表节次参数无效说明
Browse files Browse the repository at this point in the history
  • Loading branch information
Airmole committed Feb 6, 2024
1 parent 0dd31df commit b838f86
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 12 deletions.
14 changes: 8 additions & 6 deletions src/ClassCourseTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,9 @@ public function getProfessionsByCollege(string $collegeCode = '', string $grade
* @param string $weekEnd 结束周(值1~30)
* @param string $dayOfWeekStart 开始星期几(值1~7)
* @param string $dayOfWeekEnd 结束星期几(值1~7)
* @param string $serialNoStart 开始节数
* @param string $serialNoEnd 结束节数
* @param string $serialNoStart 开始节数(暂不生效)
* @param string $serialNoEnd 结束节数(暂不生效)
* @param int $timeout 请求超时时间(秒)
* @return array
* @throws Exception
*/
Expand All @@ -116,7 +117,8 @@ public function classCourse(
string $dayOfWeekStart = '',
string $dayOfWeekEnd = '',
string $serialNoStart = '',
string $serialNoEnd = ''
string $serialNoEnd = '',
int $timeout = 30
): array
{
$postPara = [
Expand All @@ -131,12 +133,12 @@ public function classCourse(
'zc2' => $weekEnd,
'skxq1' => $dayOfWeekStart,
'skxq2' => $dayOfWeekEnd,
'jc1' => $serialNoStart,
'jc2' => $serialNoEnd
// 'jc1' => $serialNoStart,
// 'jc2' => $serialNoEnd
];
$post = http_build_query($postPara);
$referer = $this->edusysUrl . '/jsxsd/kbcx/kbxx_xzb';
$html = $this->httpPost('/jsxsd/kbcx/kbxx_xzb_ifr', $post, $this->cookie, $referer);
$html = $this->httpPost('/jsxsd/kbcx/kbxx_xzb_ifr', $post, $this->cookie, $referer, $timeout);
$vaildHtml = $this->checkCookieByHtml($html['data']);
if ($vaildHtml !== true) throw new Exception($vaildHtml['data']);
if ($html['code'] !== self::CODE_SUCCESS) throw new Exception('获取失败');
Expand Down
13 changes: 9 additions & 4 deletions src/Edusys.php
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ public function getProfessions(string $collegeCode = '', string $grade = ''): ar
* @param string $dayOfWeekEnd 结束星期几(值1~7)
* @param string $serialNoStart 开始节数
* @param string $serialNoEnd 结束节数
* @param int $timeout 请求超时时间(秒)
* @return array
* @throws Exception
*/
Expand All @@ -279,7 +280,8 @@ public function classCourse(
string $dayOfWeekStart = '',
string $dayOfWeekEnd = '',
string $serialNoStart = '',
string $serialNoEnd = ''
string $serialNoEnd = '',
int $timeout = 30
): array
{
if (empty($this->usercode) || empty($this->cookie)) throw new Exception('账号未登录');
Expand All @@ -296,7 +298,8 @@ public function classCourse(
$dayOfWeekStart,
$dayOfWeekEnd,
$serialNoStart,
$serialNoEnd
$serialNoEnd,
$timeout
);
}

Expand Down Expand Up @@ -339,7 +342,8 @@ public function teacherCourse(
string $dayOfWeekStart = '',
string $dayOfWeekEnd = '',
string $serialNoStart = '',
string $serialNoEnd = ''
string $serialNoEnd = '',
int $timeout = 30
): array
{
if (empty($this->usercode) || empty($this->cookie)) throw new Exception('账号未登录');
Expand All @@ -355,7 +359,8 @@ public function teacherCourse(
$dayOfWeekStart,
$dayOfWeekEnd,
$serialNoStart,
$serialNoEnd
$serialNoEnd,
$timeout
);
}

Expand Down
6 changes: 4 additions & 2 deletions src/TeacherCourseTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ public function formatOptions(string $html): array
* @param string $dayOfWeekEnd 结束星期几(值1~7)
* @param string $serialNoStart 开始节数
* @param string $serialNoEnd 结束节数
* @param int $timeout 请求超时时间(秒)
* @return array
* @throws Exception
*/
Expand All @@ -92,7 +93,8 @@ public function teacherCourse(
string $dayOfWeekStart = '',
string $dayOfWeekEnd = '',
string $serialNoStart = '',
string $serialNoEnd = ''
string $serialNoEnd = '',
int $timeout = 30
): array
{
$postPara = [
Expand All @@ -112,7 +114,7 @@ public function teacherCourse(
$post = http_build_query($postPara);
$referer = $this->edusysUrl . '/jsxsd/kbcx/kbxx_teacher';

$html = $this->httpPost('/jsxsd/kbcx/kbxx_teacher_ifr', $post, $this->cookie, $referer);
$html = $this->httpPost('/jsxsd/kbcx/kbxx_teacher_ifr', $post, $this->cookie, $referer, $timeout);
$vaildHtml = $this->checkCookieByHtml($html['data']);
if ($vaildHtml !== true) throw new Exception($vaildHtml['data']);
if ($html['code'] !== self::CODE_SUCCESS) throw new Exception('获取失败');
Expand Down

0 comments on commit b838f86

Please sign in to comment.