@@ -29,6 +29,11 @@ const BACKUP_KEYS = {
2929 LIVE_CONFIG_URL : 'drplayer_live_config_url' ,
3030 CURRENT_SITE : 'drplayer_current_site' ,
3131
32+ // 聚合搜索相关
33+ SEARCH_AGGREGATION_SETTINGS : 'searchAggregationSettings' , // 聚合搜索源选择设置
34+ SEARCH_AGGREGATION_PAGE_STATE : 'pageState_searchAggregation' , // 聚合搜索页面状态
35+ SEARCH_HISTORY : 'drplayer_search_history' , // 搜索历史记录
36+
3237 // 其他功能设置
3338 SKIP_SETTINGS : 'skipSettings' ,
3439 PARSER_CONFIG : 'parserConfig' ,
@@ -146,6 +151,8 @@ export const collectBackupData = () => {
146151 parserConfig : getLocalStorageData ( BACKUP_KEYS . PARSER_CONFIG , { } ) ,
147152 // 解析器数据
148153 parsers : getLocalStorageData ( BACKUP_KEYS . PARSERS , [ ] ) ,
154+ // 聚合搜索设置
155+ searchAggregationSettings : getLocalStorageData ( BACKUP_KEYS . SEARCH_AGGREGATION_SETTINGS , { } ) ,
149156 // 侧边栏状态
150157 sidebarCollapsed : getLocalStorageData ( BACKUP_KEYS . SIDEBAR_COLLAPSED , false ) ,
151158 // 页面状态
@@ -160,6 +167,10 @@ export const collectBackupData = () => {
160167 watchHistory : getLocalStorageData ( BACKUP_KEYS . WATCH_HISTORY , [ ] ) ,
161168 // 历史页面数据(historyStore使用)
162169 histories : getLocalStorageData ( BACKUP_KEYS . HISTORIES , [ ] ) ,
170+ // 搜索历史记录
171+ searchHistory : getLocalStorageData ( BACKUP_KEYS . SEARCH_HISTORY , [ ] ) ,
172+ // 聚合搜索页面状态
173+ searchAggregationPageState : getLocalStorageData ( BACKUP_KEYS . SEARCH_AGGREGATION_PAGE_STATE , { } ) ,
163174 // 每日统计
164175 dailyStats : getLocalStorageData ( BACKUP_KEYS . DAILY_STATS , { } ) ,
165176 // 周统计
@@ -283,6 +294,14 @@ export const restoreBackupData = (backupData) => {
283294 failedCount ++
284295 errors . push ( `解析器数据` )
285296 }
297+ } else if ( key === 'searchAggregationSettings' ) {
298+ // 特殊处理聚合搜索设置
299+ if ( setLocalStorageData ( BACKUP_KEYS . SEARCH_AGGREGATION_SETTINGS , value ) ) {
300+ restoredCount ++
301+ } else {
302+ failedCount ++
303+ errors . push ( `聚合搜索设置` )
304+ }
286305 } else {
287306 const storageKey = Object . values ( BACKUP_KEYS ) . find ( k => k . includes ( key ) || key . includes ( k . split ( '_' ) . pop ( ) ) )
288307 if ( storageKey ) {
@@ -312,7 +331,9 @@ export const restoreBackupData = (backupData) => {
312331 watchHistory : BACKUP_KEYS . WATCH_HISTORY ,
313332 dailyStats : BACKUP_KEYS . DAILY_STATS ,
314333 weeklyStats : BACKUP_KEYS . WEEKLY_STATS ,
315- histories : BACKUP_KEYS . HISTORIES // 历史页面数据
334+ histories : BACKUP_KEYS . HISTORIES , // 历史页面数据
335+ searchHistory : BACKUP_KEYS . SEARCH_HISTORY , // 搜索历史记录
336+ searchAggregationPageState : BACKUP_KEYS . SEARCH_AGGREGATION_PAGE_STATE // 聚合搜索页面状态
316337 }
317338
318339 for ( const [ key , value ] of Object . entries ( backupData . userData ) ) {
0 commit comments