Fix issue with GC API implementation

This commit is contained in:
KingRainbow44
2022-05-22 23:42:07 -04:00
parent 8383fcfd1f
commit 5c57a2bde0
5 changed files with 12 additions and 7 deletions

1
src-tauri/Cargo.lock generated
View File

@@ -718,6 +718,7 @@ checksum = "b365fabc795046672053e29c954733ec3b05e4be654ab130fe8f1f94d7051f35"
name = "cultivation"
version = "0.1.0"
dependencies = [
"base64",
"futures-util",
"http",
"hudsucker",

View File

@@ -34,8 +34,9 @@ registry = "1.2.1"
# Program opener.
open = "2.1.2"
# Serialization library.
# Serialization.
serde_json = "1"
base64 = "0.13.0"
# Dependencies for the HTTP(S) proxy.
http = "0.2"

View File

@@ -36,6 +36,7 @@ fn main() {
disconnect,
req_get,
get_bg_file,
base64_decode,
system_helpers::run_program,
system_helpers::run_jar,
system_helpers::open_in_browser,
@@ -171,4 +172,10 @@ async fn get_bg_file(bg_path: String) -> String {
"".to_string()
}
};
}
#[tauri::command]
fn base64_decode(encoded: String) -> String {
let decoded = base64::decode(&encoded).unwrap();
return String::from_utf8(decoded).unwrap();
}