@@ -95,7 +95,7 @@ export class IndexedDBStorageManager {
9595
9696 // 创建备份存储
9797 if ( ! db . objectStoreNames . contains ( STORES . BACKUP ) ) {
98- const backupStore = db . createObjectStore ( STORES . BACKUP , { keyPath : 'timestamp' } ) ;
98+ db . createObjectStore ( STORES . BACKUP , { keyPath : 'timestamp' } ) ;
9999 }
100100 } ;
101101 } ) ;
@@ -502,7 +502,7 @@ export class IndexedDBStorageManager {
502502
503503 if ( favoriteOnly ) {
504504 const index = historyStore . index ( 'favorite' ) ;
505- request = index . getAll ( true ) ;
505+ request = index . getAll ( 1 ) ;
506506 } else {
507507 request = historyStore . getAll ( ) ;
508508 }
@@ -513,30 +513,30 @@ export class IndexedDBStorageManager {
513513 // 应用过滤条件
514514 if ( searchText ) {
515515 const searchLower = searchText . toLowerCase ( ) ;
516- results = results . filter ( entry =>
516+ results = results . filter ( ( entry : HistoryEntry ) =>
517517 entry . inputCurl . toLowerCase ( ) . includes ( searchLower ) ||
518518 entry . outputCurl . toLowerCase ( ) . includes ( searchLower ) ||
519519 ( entry . title && entry . title . toLowerCase ( ) . includes ( searchLower ) )
520520 ) ;
521521 }
522522
523523 if ( tags && tags . length > 0 ) {
524- results = results . filter ( entry =>
525- entry . tags && entry . tags . some ( tag => tags . includes ( tag ) )
524+ results = results . filter ( ( entry : HistoryEntry ) =>
525+ entry . tags && entry . tags . some ( ( tag : string ) => tags . includes ( tag ) )
526526 ) ;
527527 }
528528
529529 if ( dateRange ) {
530530 const startTime = new Date ( dateRange . start ) . getTime ( ) ;
531531 const endTime = new Date ( dateRange . end ) . getTime ( ) ;
532- results = results . filter ( entry => {
532+ results = results . filter ( ( entry : HistoryEntry ) => {
533533 const entryTime = new Date ( entry . timestamp ) . getTime ( ) ;
534534 return entryTime >= startTime && entryTime <= endTime ;
535535 } ) ;
536536 }
537537
538538 // 排序
539- results . sort ( ( a , b ) => {
539+ results . sort ( ( a : HistoryEntry , b : HistoryEntry ) => {
540540 let aValue : any , bValue : any ;
541541 if ( sortBy === 'timestamp' ) {
542542 aValue = new Date ( a . timestamp ) . getTime ( ) ;
@@ -811,7 +811,7 @@ export class IndexedDBStorageManager {
811811 */
812812 async clearStorage ( ) : Promise < void > {
813813 try {
814- const db = await this . ensureDB ( ) ;
814+ await this . ensureDB ( ) ;
815815 const storeNames = [ STORES . CONFIG , STORES . RULES , STORES . HISTORY , STORES . BACKUP ] ;
816816
817817 await this . executeTransaction ( storeNames , 'readwrite' , ( stores ) => {
0 commit comments