mirror of
https://github.com/SECTL/SecScore.git
synced 2026-07-19 19:04:23 +08:00
添加清除数据按钮、为OOBE修改命名
This commit is contained in:
@@ -7,7 +7,7 @@ edition = "2021"
|
|||||||
rust-version = "1.70"
|
rust-version = "1.70"
|
||||||
|
|
||||||
[lib]
|
[lib]
|
||||||
name = "secscore"
|
name = "secscore_lib"
|
||||||
crate-type = ["staticlib", "cdylib", "lib"]
|
crate-type = ["staticlib", "cdylib", "lib"]
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
use parking_lot::RwLock;
|
use parking_lot::RwLock;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
use tauri::{AppHandle, Emitter, State};
|
use tauri::{AppHandle, Emitter, Manager, State};
|
||||||
|
|
||||||
use crate::db::connection::{create_sqlite_connection, DatabaseType};
|
use crate::db::connection::{create_sqlite_connection, DatabaseType};
|
||||||
use crate::db::migration::Migration;
|
use crate::db::migration::Migration;
|
||||||
@@ -34,10 +34,10 @@ fn sqlite_db_path(app_handle: &AppHandle) -> Result<String, String> {
|
|||||||
std::fs::create_dir_all(&data_dir)
|
std::fs::create_dir_all(&data_dir)
|
||||||
.map_err(|e| format!("Failed to create data directory: {}", e))?;
|
.map_err(|e| format!("Failed to create data directory: {}", e))?;
|
||||||
let db_path = data_dir.join("data.sql");
|
let db_path = data_dir.join("data.sql");
|
||||||
db_path
|
match db_path.to_str() {
|
||||||
.to_str()
|
Some(path) => Ok(path.to_owned()),
|
||||||
.map(|s| s.to_string())
|
None => Err("Invalid sqlite database path".to_string()),
|
||||||
.ok_or_else(|| "Invalid sqlite database path".to_string())
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tauri::command]
|
#[tauri::command]
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
|
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
secscore::run();
|
secscore_lib::run();
|
||||||
}
|
}
|
||||||
|
|||||||
+783
-783
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user