浏览代码

Работа над LibsPage (ExternalLibs)

Book Pauk 4 年之前
父节点
当前提交
593e201f79

+ 3 - 3
client/components/App.vue

@@ -195,9 +195,9 @@ class App extends Vue {
     redirectIfNeeded() {
     redirectIfNeeded() {
         if ((this.mode == 'reader' || this.mode == 'omnireader' || this.mode == 'liberama.top')) {
         if ((this.mode == 'reader' || this.mode == 'omnireader' || this.mode == 'liberama.top')) {
             const search = window.location.search.substr(1);
             const search = window.location.search.substr(1);
-            //распознавание параметра p , если присутствует, должен совпадать с rootRoute (необходимо для nginx)
-            const q = utils.parseQuery(search);
-            if (q.p && `/${q.p}` != this.rootRoute) {
+
+            //распознавание хоста, если присутствует домен 3-уровня "b.", то разрешена только определенная страница
+            if (window.location.host.indexOf('b.') == 0 && this.rootRoute != '/external-libs') {
                 this.$router.replace('/404');
                 this.$router.replace('/404');
                 //чтобы ниоткуда нельзя было изменить путь (если какие-то страницы еще грузятся)
                 //чтобы ниоткуда нельзя было изменить путь (если какие-то страницы еще грузятся)
                 this.$router.push = this.$router.replace = null;
                 this.$router.push = this.$router.replace = null;

+ 1 - 1
client/components/ExternalLibs/ExternalLibs.vue

@@ -96,7 +96,7 @@ class ExternalLibs extends Vue {
         const openerOrigin2 = `https://${openerHost}`;
         const openerOrigin2 = `https://${openerHost}`;
 
 
         window.addEventListener('message', (event) => {
         window.addEventListener('message', (event) => {
-            if (event.origin != openerOrigin1 && event.origin != openerOrigin2)
+            if (event.origin !== openerOrigin1 && event.origin !== openerOrigin2)
                 return;
                 return;
             if (!_.isObject(event.data) || event.data.from != 'LibsPage')
             if (!_.isObject(event.data) || event.data.from != 'LibsPage')
                 return;
                 return;

+ 1 - 1
client/components/Reader/LibsPage/LibsPage.vue

@@ -32,7 +32,7 @@ class LibsPage extends Vue {
         const subdomain = (window.location.protocol != 'http:' ? 'b.' : '');
         const subdomain = (window.location.protocol != 'http:' ? 'b.' : '');
         const origin = `http://${subdomain}${window.location.host}`;
         const origin = `http://${subdomain}${window.location.host}`;
 
 
-        this.popupWindow = window.open(`${origin}/?p=external-libs#/external-libs`);
+        this.popupWindow = window.open(`${origin}/#/external-libs`);
 
 
         if (this.popupWindow) {
         if (this.popupWindow) {