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

This commit is contained in:
Book Pauk
2020-10-28 22:45:05 +07:00
parent d7b24253fe
commit 593e201f79
3 changed files with 5 additions and 5 deletions

View File

@@ -195,9 +195,9 @@ class App extends Vue {
redirectIfNeeded() {
if ((this.mode == 'reader' || this.mode == 'omnireader' || this.mode == 'liberama.top')) {
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.push = this.$router.replace = null;

View File

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

View File

@@ -32,7 +32,7 @@ class LibsPage extends Vue {
const subdomain = (window.location.protocol != 'http:' ? 'b.' : '');
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) {