lnu-elytra 0.0.8

LNU 岭南师范学院 正方教务系统 抢课 选课工具
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use crate::{
    Client, Error,
    error::R,
    utils::{ToHtml, UseInputValue},
};

impl Client {
    pub async fn check_login(&self) -> R<String> {
        self.get(&Client::LOGIN_URL)
            .send()
            .await?
            .doc()
            .await?
            .use_val(&Client::S_SESSION_USER_KEY)
            .map(|s| s.to_owned())
            .map_err(|_| Error::LoginFailed)
    }
}