stuff idk

This commit is contained in:
Ethan O'Brien
2024-05-24 12:43:34 -05:00
parent 7df2f3e277
commit baa14654f5
24 changed files with 443 additions and 794 deletions

View File

@@ -1,10 +1,10 @@
use json::object;
use json::{object, array, JsonValue};
use actix_web::{HttpResponse, HttpRequest};
use crate::router::{userdata, global};
use crate::encryption;
pub fn tutorial(req: HttpRequest, body: String) -> HttpResponse {
pub fn tutorial(req: HttpRequest, body: String) -> Option<JsonValue> {
let key = global::get_login(req.headers(), &body);
let body = json::parse(&encryption::decrypt_packet(&body).unwrap()).unwrap();
let mut user = userdata::get_acc(&key);
@@ -15,10 +15,5 @@ pub fn tutorial(req: HttpRequest, body: String) -> HttpResponse {
userdata::save_acc(&key, user);
let resp = object!{
"code": 0,
"server_time": global::timestamp(),
"data": []
};
global::send(resp, req)
Some(array![])
}