-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #43 from FarmerChillax/add-type
添加 cookies 的登录方式,并完善 typo
- Loading branch information
Showing
8 changed files
with
72 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,14 @@ | ||
# 概览 | ||
|
||
|
||
| Api | Description | Argument | | ||
| :-------------------------------- | :-------------------------- | :---------------- | | ||
| [user_login](./user_login.md) | 登陆函数 | account, password | | ||
| [get_schedule](./get_schedule.md) | 课表查询 | year, term | | ||
| [get_score](./get_score.md) | 成绩查询 | year, term | | ||
| [get_info](./get_info.md) | 获取个人信息 | None | | ||
| [refresh_info](./others.md) | 刷新个人信息 | None | | ||
| [check_session](./others.md) | 检查session并其失效后重登录 | None | | ||
| Api | Description | Argument | | ||
| :----------------------------------------- | :-------------------------------------------------------------- | :---------------- | | ||
| [user_login](./user_login.md) | 登陆函数 | account, password | | ||
| [user_login_with_cookies](./user_login.md) | cookie 登陆函数 | cookies, account | | ||
| [init_dev_user](./user_login.md) | 开发测试函数,主要用于开发者调试使用,传入 cookie,无需频繁登录 | cookies | | ||
| [get_schedule](./get_schedule.md) | 课表查询 | year, term | | ||
| [get_score](./get_score.md) | 成绩查询 | year, term | | ||
| [get_info](./get_info.md) | 获取个人信息 | None | | ||
| [refresh_info](./others.md) | 刷新个人信息 | None | | ||
| [check_session](./others.md) | 检查session并其失效后重登录 | None | | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# -*- coding: utf-8 -*- | ||
''' | ||
:file: dev_example.py | ||
:author: -Farmer | ||
:url: https://blog.farmer233.top | ||
:date: 2022/01/06 20:34:12 | ||
''' | ||
from school_sdk import SchoolClient | ||
from school_sdk.client import UserClient | ||
|
||
# 实例化学校 | ||
Gdust = SchoolClient("172.16.254.1", port=2333) | ||
|
||
# 实例化用户 | ||
cookies_str = "<Your cookies string>" # e.g JSESSIONID=E738AE92B3CF133171F5B8E3E4643A5E | ||
user: UserClient = Gdust.user_login_with_cookies(cookies_str, account="2018xxxxxx") | ||
|
||
# 获取课表 | ||
course = user.get_schedule(year=2020, term=2) | ||
print(course) | ||
|
||
# 获取成绩, 2020-2021学年第一学期的成绩 | ||
score = user.get_score(year=2020, term=1) | ||
print(score) | ||
|
||
# 获取个人信息 | ||
info = user.get_info() | ||
print(info) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# -*- coding: utf-8 -*- | ||
''' | ||
:file: __init__.py | ||
:author: -Farmer | ||
:url: https://blog.farmer233.top | ||
:date: 2024/01/12 19:18:47 | ||
''' | ||
|
||
from .client import CAPTCHA, KCAPTCHA |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters