diff --git a/wallitor-gui/src-tauri/src/lib.rs b/wallitor-gui/src-tauri/src/lib.rs
index 170e29d..c33b35a 100644
--- a/wallitor-gui/src-tauri/src/lib.rs
+++ b/wallitor-gui/src-tauri/src/lib.rs
@@ -74,7 +74,7 @@ async fn new_wallpaper(info:AddInfo) -> String{
let base_url = String::from("./resource");
let current_time:i64 = Local::now().timestamp();
let folder = format!("{}/{}",base_url,current_time);
- if fs::create_dir(Path::new(&folder)).is_err(){
+ if fs::create_dir_all(Path::new(&folder)).is_err(){
return String::from("Error creating folder.");
}
if let Ok(false) = fs::exists(Path::new(&info.preview)){
diff --git a/wallitor-gui/src/components/ApplyBar.vue b/wallitor-gui/src/components/ApplyBar.vue
index e33b3c1..46e52bf 100644
--- a/wallitor-gui/src/components/ApplyBar.vue
+++ b/wallitor-gui/src/components/ApplyBar.vue
@@ -12,7 +12,7 @@
类型
- {{ cell.config.info.type }}
+ {{ cell.config.info.media_type }}
@@ -28,7 +28,7 @@
创建时间
- {{ (new Date(cell.config.info.created)).toLocaleString() }}
+ {{ (new Date(cell.config.info.created * 1000)).toLocaleString() }}
@@ -81,7 +81,7 @@ const cell = ref| ({
}
}
})
-const info_items = ref<(keyof Info)[]>(["type", "description", "created"]);
+const info_items = ref<(keyof Info)[]>(["media_type", "description", "created"]);
const bg = ref(null);
defineExpose({ open })
watch(() => visible.value, (val, _) => {
diff --git a/wallitor-gui/src/ts/types.d.ts b/wallitor-gui/src/ts/types.d.ts
index 7214aaf..6f3642c 100644
--- a/wallitor-gui/src/ts/types.d.ts
+++ b/wallitor-gui/src/ts/types.d.ts
@@ -5,7 +5,7 @@ export interface wpConfig {
}
type WallpaperType = 'Video'
export interface Info {
- type: WallpaperType
+ media_type: WallpaperType
description: string
created: number
}
|