File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed
Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -50,14 +50,21 @@ const checkAllImagesLoaded = () => {
5050const handleCompatRedirect = async ( router : Router ) => {
5151 // 兼容旧链接/短链重定向
5252 const u = location . href . substring ( location . origin . length ) ;
53+ const replace = async ( url : string ) => {
54+ history . replaceState ( null , '' , url ) ;
55+ await router . go ( url ) ;
56+ } ;
5357 if ( location . pathname . startsWith ( '/selector/' ) ) {
5458 if ( location . pathname . at ( - 1 ) === '/' ) {
55- router . go ( '/guide/selector' ) ;
59+ replace ( '/guide/selector' ) ;
5660 } else {
57- router . go ( location . pathname . replace ( '/selector/' , '/guide/' ) ) ;
61+ replace ( location . pathname . replace ( '/selector/' , '/guide/' ) ) ;
5862 }
59- } else if ( location . pathname === '/subscription/' ) {
60- router . go ( '/guide/subscription' ) ;
63+ } else if (
64+ location . pathname === '/subscription/' ||
65+ location . pathname === '/subscription'
66+ ) {
67+ await replace ( '/guide/subscription' ) ;
6168 } else if ( location . pathname === '/' ) {
6269 const r = new URLSearchParams ( location . search ) . get ( 'r' ) ;
6370 if ( r === '1' ) {
You can’t perform that action at this time.
0 commit comments