mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-05-31 13:21:01 +08:00
更新设置相关组件:优化错误提示信息,增强用户反馈
This commit is contained in:
@@ -34,7 +34,7 @@ async function saveHandle() {
|
||||
if (result.success) {
|
||||
$toast.success('插件仓库保存成功')
|
||||
emit('save')
|
||||
} else $toast.error('插件仓库保存失败!')
|
||||
} else $toast.error(`插件仓库保存失败:${result?.message}!`)
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
|
||||
@@ -133,6 +133,11 @@ async function saveSearchSetting() {
|
||||
selectedMediaSource.value.join(','),
|
||||
)
|
||||
|
||||
if (!result1 || !result1.success) {
|
||||
$toast.error(`媒体搜索数据源保存失败:${result1?.message}!`)
|
||||
return
|
||||
}
|
||||
|
||||
const result2: { [key: string]: any } = await api.post(
|
||||
'system/setting/SearchFilterRuleGroups',
|
||||
selectedFilterGroup.value,
|
||||
@@ -140,7 +145,7 @@ async function saveSearchSetting() {
|
||||
|
||||
const result3 = await saveSystemSetting(SystemSettings.value.Basic)
|
||||
|
||||
if (result1.success && result2.success && result3) {
|
||||
if (result2.success && result3) {
|
||||
$toast.success('搜索基础设置保存成功')
|
||||
} else {
|
||||
$toast.error('搜索基础设置保存失败!')
|
||||
|
||||
@@ -177,6 +177,9 @@ async function saveSystemSetting(value: { [key: string]: any }) {
|
||||
const result: { [key: string]: any } = await api.post('system/env', value)
|
||||
if (result.success) {
|
||||
return true
|
||||
} else {
|
||||
$toast.error(`设置保存失败:${result?.message}!`)
|
||||
return false
|
||||
}
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
@@ -189,8 +192,6 @@ async function saveBasicSettings() {
|
||||
if (await saveSystemSetting(SystemSettings.value.Basic)) {
|
||||
$toast.success('基础设置保存成功')
|
||||
await reloadSystem()
|
||||
} else {
|
||||
$toast.error('基础设置保存失败!')
|
||||
}
|
||||
}
|
||||
|
||||
@@ -202,8 +203,6 @@ async function saveAdvancedSettings() {
|
||||
advancedDialog.value = false
|
||||
$toast.success('高级设置保存成功')
|
||||
await reloadSystem()
|
||||
} else {
|
||||
$toast.error('高级设置保存失败!')
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user