浏览代码

Поправки редиректа при заданном url

Book Pauk 2 年之前
父节点
当前提交
ddde7d038b
共有 2 个文件被更改,包括 9 次插入20 次删除
  1. 8 19
      client/components/App.vue
  2. 1 1
      client/components/Reader/HelpPage/CommonHelpPage/CommonHelpPage.vue

+ 8 - 19
client/components/App.vue

@@ -207,26 +207,15 @@ class App {
         return this.$store.state.config.mode;
         return this.$store.state.config.mode;
     }
     }
 
 
-    get isReaderActive() {
-        return (this.rootRoute == '/reader' || this.rootRoute == '/external-libs');
-    }
-
     redirectIfNeeded() {
     redirectIfNeeded() {
-        if ((this.mode == 'reader' || this.mode == 'omnireader' || this.mode == 'liberama')) {
-            const search = window.location.search.substr(1);
-
-            //распознавание параметра url вида "?url=<link>" и редирект при необходимости
-            if (!this.isReaderActive) {
-                const s = search.split('url=');
-                const url = s[1] || '';
-                const q = utils.parseQuery(s[0] || '');
-                if (url) {
-                    q.url = url;
-                }
-
-                window.history.replaceState({}, '', '/');
-                this.$router.replace({ path: '/reader', query: q });
-            }
+        const search = window.location.search.substr(1);
+
+        //распознавание параметра url вида "?url=<link>" и редирект при необходимости
+        const s = search.split('url=');
+        const url = s[1] || '';
+        if (url) {
+            window.history.replaceState({}, '', '/');
+            this.$router.replace({ path: '/reader', query: {url} });
         }
         }
     }
     }
 }
 }

+ 1 - 1
client/components/Reader/HelpPage/CommonHelpPage/CommonHelpPage.vue

@@ -59,7 +59,7 @@ class CommonHelpPage {
     }
     }
 
 
     get bookmarkText() {
     get bookmarkText() {
-        return `javascript:location.href='https://${window.location.host}/?url='+location.href;`
+        return `javascript:location.href='${window.location.protocol}//${window.location.host}/#/reader?url='+location.href;`
     }
     }
 
 
     async copyText(text, mes) {
     async copyText(text, mes) {