@@ -403,6 +403,7 @@ class Detail extends Component {
403
403
} ,
404
404
minedTotalCount : 0 ,
405
405
curMinedPage : 1 ,
406
+ showMaintaining : false ,
406
407
} ;
407
408
}
408
409
@@ -417,33 +418,40 @@ class Detail extends Component {
417
418
async fetchAccountDetail ( accountid , queries ) {
418
419
const { history } = this . props ;
419
420
this . setState ( { isLoading : true , accountid } ) ;
420
- const { code, result } = ( await superagent . get ( `/proxy/fetchAccountDetail/${ accountid } ` ) . query ( queries ) ) . body ;
421
- if ( ! code ) {
422
- this . setState (
423
- {
424
- accountDetail : result . find ( ( item ) => Object . keys ( item ) [ 0 ] === `account/${ accountid } ` ) [ `account/${ accountid } ` ] ,
425
- // TxList: result.find((item) => Object.keys(item)[0] === `account/${accountid}/transactionList`)[
426
- // `account/${accountid}/transactionList`
427
- // ],
428
- TxList : get (
429
- result . find ( ( item ) => Object . keys ( item ) [ 0 ] === `account/${ accountid } /transactionList` ) ,
430
- `account/${ accountid } /transactionList` ,
431
- [ ]
432
- ) ,
433
- TxTotalCount : get (
434
- result . find ( ( item ) => Object . keys ( item ) [ 0 ] === `account/${ accountid } /transactionList` ) ,
435
- `total_account/${ accountid } /transactionList` ,
436
- [ ]
437
- ) ,
438
- minedTotalCount :
439
- get ( result . find ( ( item ) => Object . keys ( item ) [ 0 ] === `account/${ accountid } ` ) , [ `account/${ accountid } ` , 'minedBlocks' ] ) || 0 ,
440
- } ,
441
- ( ) => {
442
- this . setState ( { isLoading : false , queries } ) ;
443
- }
444
- ) ;
445
- } else if ( code === 1 ) {
446
- history . push ( `/search-notfound?searchId=${ accountid } ` ) ;
421
+
422
+ try {
423
+ const { code, result } = ( await superagent . get ( `/proxy/fetchAccountDetail/${ accountid } ` ) . query ( queries ) ) . body ;
424
+ if ( ! code ) {
425
+ this . setState (
426
+ {
427
+ accountDetail : result . find ( ( item ) => Object . keys ( item ) [ 0 ] === `account/${ accountid } ` ) [ `account/${ accountid } ` ] ,
428
+ // TxList: result.find((item) => Object.keys(item)[0] === `account/${accountid}/transactionList`)[
429
+ // `account/${accountid}/transactionList`
430
+ // ],
431
+ TxList : get (
432
+ result . find ( ( item ) => Object . keys ( item ) [ 0 ] === `account/${ accountid } /transactionList` ) ,
433
+ `account/${ accountid } /transactionList` ,
434
+ [ ]
435
+ ) ,
436
+ TxTotalCount : get (
437
+ result . find ( ( item ) => Object . keys ( item ) [ 0 ] === `account/${ accountid } /transactionList` ) ,
438
+ `total_account/${ accountid } /transactionList` ,
439
+ [ ]
440
+ ) ,
441
+ minedTotalCount :
442
+ get ( result . find ( ( item ) => Object . keys ( item ) [ 0 ] === `account/${ accountid } ` ) , [ `account/${ accountid } ` , 'minedBlocks' ] ) || 0 ,
443
+ } ,
444
+ ( ) => {
445
+ this . setState ( { isLoading : false , queries } ) ;
446
+ }
447
+ ) ;
448
+ } else if ( code === 1 ) {
449
+ history . push ( `/search-notfound?searchId=${ accountid } ` ) ;
450
+ }
451
+ } catch ( e ) {
452
+ this . setState ( {
453
+ showMaintaining : true ,
454
+ } ) ;
447
455
}
448
456
return { } ;
449
457
}
@@ -482,6 +490,7 @@ class Detail extends Component {
482
490
accountid,
483
491
minedTotalCount,
484
492
curMinedPage,
493
+ showMaintaining,
485
494
} = this . state ;
486
495
const {
487
496
intl,
@@ -568,6 +577,11 @@ class Detail extends Component {
568
577
569
578
return (
570
579
< div className = "page-address-detail" >
580
+ { showMaintaining && (
581
+ < div className = "message message-important-light" >
582
+ < span > { intl . formatMessage ( { id : 'system maintaining, please visit after 9/9' } ) } </ span >
583
+ </ div >
584
+ ) }
571
585
< Wrapper >
572
586
< HeadBar >
573
587
< h1 > { i18n ( 'Account' ) } </ h1 >
0 commit comments