Работа над LibsPage (ExternalLibs)
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user