11
This commit is contained in:
@@ -43,7 +43,7 @@ pub fn api_base() -> String {
|
||||
"http://81.71.163.140:8001".to_string()
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
/// 将库表 `name` 转为 Node 环境变量名(不含前缀),如 `llm.api_key` → `LLM_API_KEY`。
|
||||
pub fn normalize_config_key(name: &str) -> String {
|
||||
|
||||
@@ -29,8 +29,8 @@ pub mod oss;
|
||||
pub mod publish_db;
|
||||
pub mod publish_store;
|
||||
|
||||
use tauri::Manager;
|
||||
|
||||
use tauri::{Manager, WebviewUrl, WebviewWindowBuilder};
|
||||
#[cfg_attr(mobile, tauri::mobile_entry_point)]
|
||||
pub fn run() {
|
||||
let _ = env_logger::try_init();
|
||||
@@ -45,6 +45,7 @@ pub fn run() {
|
||||
.manage(video_store::VideoStore::new())
|
||||
.manage(publish_store::PublishStore::new())
|
||||
.setup(|app| {
|
||||
|
||||
let handle = app.handle().clone();
|
||||
let heartbeat_handle = handle.clone();
|
||||
let oem_id = oem_id::load_oem_id(&handle);
|
||||
@@ -78,6 +79,28 @@ pub fn run() {
|
||||
.map_err(|e| -> Box<dyn std::error::Error> { e.into() })?;
|
||||
|
||||
api_client::spawn_heartbeat_loop(heartbeat_handle);
|
||||
let url = if cfg!(debug_assertions) {
|
||||
WebviewUrl::External(
|
||||
"http://localhost:1420/"
|
||||
.parse()
|
||||
.unwrap()
|
||||
)
|
||||
} else {
|
||||
WebviewUrl::External(
|
||||
"http://81.70.234.81/images/newyaoyan/index.html"
|
||||
.parse()
|
||||
.unwrap()
|
||||
)
|
||||
};
|
||||
|
||||
WebviewWindowBuilder::new(
|
||||
app,
|
||||
"main",
|
||||
url,
|
||||
)
|
||||
.title("MyApp")
|
||||
.build()?;
|
||||
|
||||
Ok(())
|
||||
})
|
||||
.plugin(tauri_plugin_single_instance::init(|app, _args, _cwd| {
|
||||
|
||||
@@ -12,15 +12,7 @@
|
||||
"app": {
|
||||
"withGlobalTauri": true,
|
||||
"windows": [
|
||||
{
|
||||
"label": "main",
|
||||
"title": "aiclient",
|
||||
"width": 800,
|
||||
"height": 600,
|
||||
"maximized": true,
|
||||
"decorations": false,
|
||||
"resizable": true
|
||||
}
|
||||
|
||||
],
|
||||
"security": {
|
||||
"csp": null,
|
||||
|
||||
Reference in New Issue
Block a user