mirror of
https://github.com/OpenListTeam/OpenList-Desktop.git
synced 2025-11-25 03:14:56 +08:00
fix: set current directory for command execution and manage admin password state #66
This commit is contained in:
@@ -73,6 +73,7 @@ async fn execute_openlist_admin_set(
|
||||
|
||||
let mut cmd = Command::new(&openlist_exe);
|
||||
cmd.args(["admin", "set", password]);
|
||||
cmd.current_dir(app_dir);
|
||||
|
||||
if let Some(settings) = state.get_settings()
|
||||
&& !settings.openlist.data_dir.is_empty()
|
||||
|
||||
@@ -23,6 +23,7 @@ const rcloneSettings = reactive({ ...appStore.settings.rclone })
|
||||
const appSettings = reactive({ ...appStore.settings.app })
|
||||
let originalOpenlistPort = openlistCoreSettings.port || 5244
|
||||
let originalDataDir = openlistCoreSettings.data_dir
|
||||
let originalAdminPassword = appStore.settings.app.admin_password || ''
|
||||
|
||||
watch(autoStartApp, async newValue => {
|
||||
if (newValue) {
|
||||
@@ -117,7 +118,6 @@ const handleSave = async () => {
|
||||
appStore.settings.rclone = { ...rcloneSettings }
|
||||
appStore.settings.app = { ...appSettings }
|
||||
|
||||
const originalAdminPassword = appStore.settings.app.admin_password
|
||||
const needsPasswordUpdate = originalAdminPassword !== appSettings.admin_password && appSettings.admin_password
|
||||
|
||||
if (originalOpenlistPort !== openlistCoreSettings.port || originalDataDir !== openlistCoreSettings.data_dir) {
|
||||
@@ -229,6 +229,7 @@ const loadCurrentAdminPassword = async () => {
|
||||
const password = await appStore.getAdminPassword()
|
||||
if (password) {
|
||||
appSettings.admin_password = password
|
||||
originalAdminPassword = password
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Failed to load admin password:', error)
|
||||
|
||||
Reference in New Issue
Block a user