mirror of
https://git.ethanthesleepy.one/ethanaobrien/ew
synced 2025-10-09 00:47:19 +08:00
Implement webui import
This commit is contained in:
@@ -104,6 +104,14 @@ fn get_new_uuid() -> String {
|
||||
|
||||
id
|
||||
}
|
||||
pub fn import_user(uid: i64) -> String {
|
||||
let token = get_new_uuid();
|
||||
lock_and_exec(
|
||||
"INSERT INTO users (cert, uuid, user_id) VALUES (?1, ?2, ?3)",
|
||||
params!("", token, uid)
|
||||
);
|
||||
token
|
||||
}
|
||||
fn update_cert(uid: i64, cert: &str) {
|
||||
lock_and_exec("UPDATE users SET cert=?1 WHERE user_id=?2", params!(cert, uid));
|
||||
}
|
||||
@@ -187,7 +195,6 @@ fn decrypt_transfer_password(password: &str) -> String {
|
||||
}
|
||||
|
||||
|
||||
|
||||
pub fn initialize(req: HttpRequest, body: String) -> HttpResponse {
|
||||
let body = json::parse(&body).unwrap();
|
||||
let token = create_acc(&body["token"].to_string());
|
||||
|
Reference in New Issue
Block a user