Skip to content

Commit

Permalink
v1.5.6
Browse files Browse the repository at this point in the history
  • Loading branch information
niostack committed Jul 14, 2024
1 parent 34c1c44 commit cb1f296
Show file tree
Hide file tree
Showing 13 changed files with 38 additions and 214 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Changelog

支持Tiktok亚洲版和国际版,在设置中选择对应的版本; 优化私信成功率
Support Tiktok Asia and International version, choose the corresponding version in the settings; improve the success rate of private messages
过滤私信和评论随机插入的负面表情
Filter out negative emoji in private messages and comments
121 changes: 10 additions & 111 deletions src-tauri/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 1 addition & 6 deletions src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "tiktok-matrix"
name = "TikMatrix"
version = "0.0.5"
description = "TikTok Matrix System by tikmatrix.com"
authors = ["niostack"]
Expand All @@ -20,11 +20,6 @@ tauri = { version = "1.5", features = [
"app-all",
"shell-open",
] }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
pickledb = "0.5.1"
reqwest = { version = "0.11", features = ["blocking", "multipart", "json"] }
webbrowser = "0.8.12"


[features]
Expand Down
Binary file modified src-tauri/bin/script/script.exe
Binary file not shown.
Binary file modified src-tauri/bin/script/tiktok-agent.exe
Binary file not shown.
75 changes: 2 additions & 73 deletions src-tauri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,74 +4,13 @@
// Learn more about Tauri commands at https://tauri.app/v1/guides/features/command
use std::process::{Command, Stdio};

use pickledb::{PickleDb, PickleDbDumpPolicy, SerializationMethod};
#[cfg(target_os = "windows")]
use std::os::windows::process::CommandExt;
#[derive(serde::Serialize)]
struct Settings {
server_url: String,
version: String,
}
fn setup_env() {
let settings = get_settings().unwrap();
std::env::set_var("SERVER_URL", &settings.server_url);
std::env::set_var("VERSION", &settings.version);

if cfg!(debug_assertions) {
std::env::set_var("RUST_BACKTRACE", "1");
}
}
fn get_db() -> PickleDb {
PickleDb::load(
"data/settings.db",
PickleDbDumpPolicy::AutoDump,
SerializationMethod::Json,
)
.unwrap_or_else(|_| {
PickleDb::new(
"data/settings.db",
PickleDbDumpPolicy::AutoDump,
SerializationMethod::Json,
)
})
}
#[tauri::command]
fn get_settings() -> Result<Settings, String> {
let db = get_db();

// let local_ip = local_ip_address::local_ip().unwrap();
let local_ip = "127.0.0.1";
let mut port = 8090;
if cfg!(debug_assertions) {
port = 8090;
}
let mut server_url = db
.get::<String>("server_url")
.unwrap_or_else(|| format!("http://{}:{}", local_ip, port));

if server_url.is_empty() {
server_url = format!("http://{}:{}", local_ip, port);
}
let version = db
.get::<String>("version")
.unwrap_or_else(|| "0.0.0".to_string());
return Ok(Settings {
server_url,
version,
});
}
#[tauri::command]
fn set_settings(server_url: Option<String>, version: Option<String>) {
let mut db = get_db();

if let Some(url) = server_url {
db.set("server_url", &url).unwrap();
}

if let Some(version) = version {
db.set("version", &version).unwrap();
}
}

#[tauri::command]
fn start_agent() -> u32 {
Expand Down Expand Up @@ -183,18 +122,8 @@ fn main() -> std::io::Result<()> {
stop_agent();
start_agent();
tauri::Builder::default()
.invoke_handler(tauri::generate_handler![
start_agent,
stop_agent,
get_settings,
set_settings,
open_dir
])
.setup(|app| {
let version = app.package_info().version.to_string();
set_settings(None, Some(version));
Ok(())
})
.invoke_handler(tauri::generate_handler![start_agent, stop_agent, open_dir])
.setup(|_app| Ok(()))
.run(tauri::generate_context!())
.expect("error while running tauri application");
Ok(())
Expand Down
4 changes: 2 additions & 2 deletions src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"distDir": "../dist"
},
"package": {
"productName": "tiktok-matrix",
"version": "1.5.5"
"productName": "TikMatrix",
"version": "1.5.6"
},
"tauri": {
"allowlist": {
Expand Down
6 changes: 1 addition & 5 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ export default {
selectedItem: {},
agentRunning: true,
page_title: '',
settings: {},
admin_url: "https://admin.tikmatrix.com"
}
},
Expand All @@ -137,9 +136,7 @@ export default {
invoke("stop_agent");
this.agentRunning = false;
},
get_settings() {
this.settings = invoke("get_settings");
},
open_dir(name) {
invoke("open_dir", {
name
Expand Down Expand Up @@ -187,7 +184,6 @@ export default {
}
});
this.get_settings();
// this.checkAuth()
this.needLogin = false
this.showDemoTip = import.meta.env.VITE_APP_MOCK === 'true'
Expand Down
Loading

0 comments on commit cb1f296

Please sign in to comment.