Bläddra i källkod

Добавил преобразование маршрута "/?url=" => "/#/reader?url="

Book Pauk 6 år sedan
förälder
incheckning
e1721318ab
1 ändrade filer med 9 tillägg och 1 borttagningar
  1. 9 1
      client/components/App.vue

+ 9 - 1
client/components/App.vue

@@ -53,7 +53,15 @@ export default @Component({
         rootRoute: function(newValue) {
             this.setAppTitle();
             if ((this.mode == 'reader' || this.mode == 'omnireader') && (newValue != '/reader')) {
-                this.$router.replace('/reader');
+                //старый url
+                const search = window.location.search.substr(1);
+                const url = search.split('url=')[1] || '';
+                console.log(url);
+                if (url) {
+                    window.location = `/#/reader?url=${url}`;
+                } else {
+                    this.$router.replace('/reader');
+                }
             }
         },
     },