Skip to content

Commit

Permalink
Fix: 移动端编译入口错误
Browse files Browse the repository at this point in the history
  • Loading branch information
KiWi233333 committed Jan 20, 2025
1 parent 823c596 commit 4f48017
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 20 deletions.
4 changes: 2 additions & 2 deletions src-tauri/Cargo.lock

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

2 changes: 1 addition & 1 deletion src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ edition = "2021"
# The `_lib` suffix may seem redundant but it is necessary
# to make the lib name unique and wouldn't conflict with the bin name.
# This seems to be only an issue on Windows, see https://github.com/rust-lang/cargo/issues/8519
name = "jiwu_mall_chat_tauri_lib"
name = "app_lib"
crate-type = ["staticlib", "cdylib", "rlib"]

[build-dependencies]
Expand Down
1 change: 0 additions & 1 deletion src-tauri/src/desktops/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
pub mod window;
pub mod tray;
pub mod setup;
#[macro_use]
pub mod commands;
4 changes: 2 additions & 2 deletions src-tauri/src/desktops/tray.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ struct Payload {

pub fn setup_tray(app: &tauri::AppHandle) -> tauri::Result<()> {
let setting = MenuItemBuilder::with_id("setting", "设置").build(app)?;
let to_host = MenuItemBuilder::with_id("to_host", "官网").build(app)?;
let to_host = MenuItemBuilder::with_id("to_host", "博客").build(app)?;
let restart = MenuItemBuilder::with_id("restart", "重启").build(app)?;
let quit = MenuItemBuilder::with_id("quit", "退出").build(app)?;

Expand Down Expand Up @@ -51,7 +51,7 @@ pub fn setup_tray(app: &tauri::AppHandle) -> tauri::Result<()> {
.emit(
"open_url",
Payload {
message: "https://jiwu.kiwi2333.top".into(),
message: "https://kiwi233.top".into(),
},
)
.unwrap();
Expand Down
13 changes: 7 additions & 6 deletions src-tauri/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,13 @@ impl AppBuilder {
self.setup.replace(Box::new(setup));
self
}
}

pub fn run(self) {
#[cfg(desktop)]
desktops::setup::setup_desktop();
#[cfg_attr(mobile, tauri::mobile_entry_point)]
pub fn run() {
#[cfg(desktop)]
desktops::setup::setup_desktop();

#[cfg(mobile)]
mobiles::setup::setup_mobile();
}
#[cfg(mobile)]
mobiles::setup::setup_mobile();
}
3 changes: 1 addition & 2 deletions src-tauri/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Prevents additional console window on Windows in release, DO NOT REMOVE!!
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
use jiwu_mall_chat_tauri_lib::AppBuilder;

pub fn main() {
AppBuilder::new().run();
app_lib::run();
}
6 changes: 0 additions & 6 deletions src-tauri/src/mobile.rs

This file was deleted.

0 comments on commit 4f48017

Please sign in to comment.