PHP code example of airmole / tjustb-edusys

1. Go to this page and download the library: Download airmole/tjustb-edusys library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

airmole / tjustb-edusys example snippets


use Airmole\TjustbEdusys\Edusys;

$usercode = '123456789'; // 系统账号
$password = '*********'; // 系统密码
$edusys = new Edusys();
// 自动登录
$edusys->autoLogin($usercode, $password); // 自动识别验证码登录,需要在项目根目录下.env文件配置EDUSYS_OCR_URL
// 手动登录
// $loginPara = $edusys->getLoginPara(); // 获取登录所需参数:cookie,captcha
// $captchaText为验证码识别结果值
// $edusys->selfLogin($usercode, $password, $captchaText, $loginPara['cookie']); 
$score = $edusys->score(); // 查询成绩
// 注销登录系统,建议每次获取完所需数据后注销登录,以免多处登录出现获取失败问题。
$edusys->logout();
print_r($score);