feat: prepare for 1.53 preview/login
This commit is contained in:
@@ -6,11 +6,15 @@ use serde::{Deserialize, Serialize};
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct GetUserPreviewApi {
|
||||
pub user_id: u32,
|
||||
pub token: Option<String>,
|
||||
}
|
||||
|
||||
impl From<u32> for GetUserPreviewApi {
|
||||
fn from(user_id: u32) -> Self {
|
||||
Self { user_id }
|
||||
Self {
|
||||
user_id,
|
||||
token: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -12,6 +12,10 @@ pub struct UserLoginApi {
|
||||
pub acsess_code: String,
|
||||
pub place_id: String,
|
||||
pub client_id: String,
|
||||
|
||||
/// QR Login 结果的 Token
|
||||
pub token: Option<String>,
|
||||
|
||||
/// false 的情况,二维码扫描后半小时可登录。
|
||||
///
|
||||
/// true 的情况,可延长至二维码扫描后的两小时可登录。
|
||||
@@ -36,7 +40,7 @@ pub struct UserLoginApiResp {
|
||||
}
|
||||
|
||||
impl UserLoginApi {
|
||||
pub fn new(user_id: u32, is_continue: bool) -> Self {
|
||||
pub fn new(user_id: u32, is_continue: bool, token: Option<String>) -> Self {
|
||||
let date_time = SystemTime::now()
|
||||
.duration_since(UNIX_EPOCH)
|
||||
.map(|t| t.as_secs())
|
||||
@@ -51,8 +55,10 @@ impl UserLoginApi {
|
||||
region_id: 13,
|
||||
acsess_code: "".to_owned(),
|
||||
place_id: 3223.to_string(),
|
||||
is_continue,
|
||||
generic_flag: 0,
|
||||
|
||||
token,
|
||||
is_continue,
|
||||
client_id: "A63E01E6170".into(),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user