- 升级tauri1.4 - 隐藏未完的页面 - 修复一些bug

This commit is contained in:
ZilongYang
2023-06-29 14:40:56 +08:00
parent a3c872c7d7
commit 3cc551fe0d
45 changed files with 5698 additions and 4692 deletions

2028
src-tauri/Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -17,7 +17,7 @@ tauri-build = { version = "1.2.1", features = [] }
[dependencies]
serde_json = "1.0"
serde = { version = "1.0", features = ["derive"] }
tauri = { version = "1.2.2", features = ["api-all", "devtools"] }
tauri = { version = "1.4.0", features = [ "updater", "api-all", "devtools"] }
[features]
# by default Tauri runs in production mode

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 716 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 147 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 147 KiB

BIN
src-tauri/icons/zmusic.icns Normal file

Binary file not shown.

BIN
src-tauri/icons/zmusic.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

BIN
src-tauri/icons/zmusic.psd Normal file

Binary file not shown.

View File

@@ -3,8 +3,83 @@
windows_subsystem = "windows"
)]
use tauri::Manager;
use serde::{Deserialize, Serialize};
use serde_json::{Result, Value, json};
#[derive(Serialize, Deserialize, Debug)]
struct ZEvent {
sender: String,
data: Option<String>
}
impl ZEvent {
fn default() -> Self {
ZEvent { sender: String::default(), data: None }
}
}
fn main() {
tauri::Builder::default()
.setup(move |app| {
// let sp = app.get_window("splashscreen").unwrap();
let main = app.get_window("main").unwrap();
// sp.show().unwrap();
app.listen_global("dom-loaded", move |event| {
// let data = event.payload();
let v = json!(
{
"sender": "haah",
"data": {
"id": 234421,
"message": "测试消息"
}
}
);
if let Some(data) = event.payload() {
let jdata: Value = serde_json::from_str(data).unwrap();
let ev: Option<ZEvent> = serde_json::from_str(data).ok();
// match serde_json::from_str(data) {
// Ok(ev) => {}
// _ => {}
// }
println!("jdata is {}, ev is {:?}", jdata, ev);
// return;
// match ev.sender.as_str() {
// "discover/recommend" => {
// main.show().unwrap();
// println!("main is ready to show");
// }
// _ => {}
// }
if let Some(data) = jdata["data"].as_object() {
}
if let Some(sender) = jdata["sender"].as_str() {
match sender {
"discover/recommend" => {
main.show().unwrap();
println!("main is ready to show");
}
_ => {}
}
}
}
});
Ok(())
})
.run(tauri::generate_context!())
.expect("error while running tauri application");
}

View File

@@ -4,11 +4,12 @@
"beforeBuildCommand": "yarn build:for:electron",
"beforeDevCommand": "yarn dev",
"devPath": "http://localhost:3301",
"distDir": "../dist"
"distDir": "../dist",
"withGlobalTauri": true
},
"package": {
"productName": "zmusic",
"version": "0.1.0"
"version": "0.1.3"
},
"tauri": {
"allowlist": {
@@ -23,19 +24,20 @@
},
"externalBin": [],
"icon": [
"icons/32x32.png",
"icons/128x128.png",
"icons/128x128@2x.png",
"icons/icon.icns",
"icons/icon.ico"
"icons/icon_32x32.png",
"icons/icon_32x32@2x.png",
"icons/icon_128x128.png",
"icons/icon_128x128@2x.png",
"icons/zmusic.icns",
"icons/zmusic.ico"
],
"identifier": "com.zlyum.zmusic",
"longDescription": "",
"identifier": "com.zlmix.zmusic",
"longDescription": "zmusic",
"macOS": {
"entitlements": null,
"exceptionDomain": "",
"frameworks": [],
"providerShortName": null,
"providerShortName": "zmusic",
"signingIdentity": null
},
"resources": [],
@@ -51,17 +53,24 @@
},
"updater": {
"active": false
"active": true,
"endpoints": [
"https://zlmix.com/zupdater/zmusic/update.json"
],
"dialog": true,
"pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IDg4MjUyRTQ3M0Y3OTMwNkIKUldSck1Iay9SeTRsaVB6Q3ZNaUJSbUp4dURhWjJRdm8wU2pOcS92bXdJa1VhbzJQeU9VY3haTFQK"
},
"windows": [
{
"fullscreen": false,
"height": 600,
"resizable": true,
"title": "zmusic",
"width": 800,
"height": 620,
"minWidth": 800,
"minHeight": 600
"minHeight": 620,
"visible": false,
"label": "main"
}
]

11
src-tauri/update.json Normal file
View File

@@ -0,0 +1,11 @@
{
"version": "v0.1.3",
"notes": "修复搜索问题",
"pub_date": "2023-06-29T09:00:00Z",
"platforms": {
"darwin-aarch64": {
"signature": "dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVSck1Iay9SeTRsaURvSVRKMEQxZ2Zwb2tEek9pem1LdVNMUWoxVU1LSzRRMzBGNlBKRE1VRU5weFh1c1FFNWRmM1VSd1phZ2drdVlMSHVRSkJ3YUhFbDBVQ3FrZHlRZUEwPQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNjg4MDAxNTg3CWZpbGU6em11c2ljLmFwcC50YXIuZ3oKZUJaK0tmS2JPN1h1UVVXQWlSbHovWHppb0pFbVdJV0ROcTRIR2IrWnRXSjVtakFZKzh0ZmRkekVreDBoLzdmOGppSkNqam0wT09VQjM1a1JaUmpWQUE9PQo=",
"url": "https://zlmix.com/zupdater/zmusic/0.1.3/zmusic.app.tar.gz"
}
}
}