Работа над LibsPage (ExternalLibs)
This commit is contained in:
@@ -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);
|
//распознавание хоста, если присутствует домен 3-уровня "b.", то разрешена только определенная страница
|
||||||
if (q.p && `/${q.p}` != this.rootRoute) {
|
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;
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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) {
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user