1
0
This commit is contained in:
syui 2024-02-19 12:29:40 +09:00
parent 3a19a207f3
commit 533ea62492
Signed by: syui
GPG Key ID: 5417CFEBAD92DF56

View File

@ -540,10 +540,12 @@ pub fn w_refresh(res: &str) {
let mut f = fs::File::create(f.clone()).unwrap(); let mut f = fs::File::create(f.clone()).unwrap();
let mut ff = fs::File::create(ff.clone()).unwrap(); let mut ff = fs::File::create(ff.clone()).unwrap();
f.write_all(&res.as_bytes()).unwrap(); f.write_all(&res.as_bytes()).unwrap();
let json: Token = serde_json::from_str(&res).unwrap(); let token = data_toml(&"access");
let refresh = data_toml(&"refresh");
//let json: Token = serde_json::from_str(&res).unwrap();
let refreshs = Refresh { let refreshs = Refresh {
access: json.accessJwt.to_string(), access: token.to_string(),
refresh: json.refreshJwt.to_string(), refresh: refresh.to_string(),
}; };
let toml = toml::to_string(&refreshs).unwrap(); let toml = toml::to_string(&refreshs).unwrap();
ff.write_all(&toml.as_bytes()).unwrap(); ff.write_all(&toml.as_bytes()).unwrap();