@@ -1543,7 +1543,6 @@ <h2 :class="version === ver.version ? 'primary--text' : undefined">v{{ver.versio
15431543 watch : {
15441544 'ui.path' : {
15451545 handler ( newval , oldval ) {
1546- this . handleHistory ( newval )
15471546 if ( / ^ \/ # / . test ( newval ) ) {
15481547 newval = newval . replace ( '/#' , '' )
15491548 }
@@ -1680,7 +1679,7 @@ <h2 :class="version === ver.version ? 'primary--text' : undefined">v{{ver.versio
16801679 ( error ) => ( this . isLoading = false )
16811680 )
16821681 } ,
1683- async created ( ) {
1682+ created ( ) {
16841683 // 如果 url 参数中指定的 baseURL, 则后续的请求都请求到指定的域
16851684 if ( window . location . search ) {
16861685 const [ , baseURL ] = / b a s e U R L = ( .* ?) ( & | $ ) / . exec ( window . location . search )
@@ -1695,17 +1694,18 @@ <h2 :class="version === ver.version ? 'primary--text' : undefined">v{{ver.versio
16951694 } else {
16961695 this . path = defview
16971696 }
1697+ this . handleHistory ( this . path )
16981698 // 监听浏览器后退事件
16991699 window . addEventListener ( 'popstate' , ( e ) => ( this . path = e . state . url ) , false )
17001700 // 如果后端没有渲染数据, 则发出请求获取数据
17011701 if ( this . boxServerData ) {
17021702 this . box = this . boxServerData
17031703 } else {
1704- await axios . get ( '/query/boxdata' ) . then ( ( resp ) => ( this . box = resp . data ) )
1704+ axios . get ( '/query/boxdata' ) . then ( ( resp ) => ( this . box = resp . data ) )
17051705 }
17061706 // 获取全局备份
17071707 if ( this . view === 'bak' ) {
1708- await this . loadGlobalBak ( )
1708+ this . loadGlobalBak ( )
17091709 }
17101710 this . getVersions ( )
17111711 this . loadTheme ( )
@@ -1726,8 +1726,10 @@ <h2 :class="version === ver.version ? 'primary--text' : undefined">v{{ver.versio
17261726 back ( ) {
17271727 if ( this . view === 'bak' && ! this . bfpath ) {
17281728 this . path = '/#/my'
1729+ this . handleHistory ( this . path )
17291730 } else if ( this . view === 'app' && ! this . bfpath ) {
17301731 this . path = '/#/app'
1732+ this . handleHistory ( this . path )
17311733 } else {
17321734 history . back ( )
17331735 }
@@ -1741,6 +1743,7 @@ <h2 :class="version === ver.version ? 'primary--text' : undefined">v{{ver.versio
17411743 path = `/#/${ path } `
17421744 if ( this . path !== path ) {
17431745 this . path = path
1746+ this . handleHistory ( this . path )
17441747 } else {
17451748 const scrollY = this . ui . scrollY [ this . path ]
17461749 const isTopY = _ . isNil ( scrollY ) || scrollY === 0
@@ -1758,6 +1761,7 @@ <h2 :class="version === ver.version ? 'primary--text' : undefined">v{{ver.versio
17581761 switchAppView ( appId ) {
17591762 const path = `/#/app/${ appId } `
17601763 this . path = path
1764+ this . handleHistory ( this . path )
17611765 } ,
17621766 // 切换备份视图
17631767 switchBakView ( bakId ) {
@@ -1767,6 +1771,7 @@ <h2 :class="version === ver.version ? 'primary--text' : undefined">v{{ver.versio
17671771 this . loadGlobalBak ( ) . then ( ( resp ) => ( this . path = path ) )
17681772 } else {
17691773 this . path = path
1774+ this . handleHistory ( this . path )
17701775 }
17711776 } ,
17721777 // 重载主题
0 commit comments