зеркало из https://github.com/nextcloud/spreed.git
Set no rewrite for generateUrl, in case URL contains index.php despite configured rewrite
Signed-off-by: Ivan Sein <ivan@nextcloud.com>
This commit is contained in:
Родитель
cba9d4e9d9
Коммит
d7bfddb22f
|
@ -22,18 +22,24 @@
|
||||||
|
|
||||||
import Vue from 'vue'
|
import Vue from 'vue'
|
||||||
import Router from 'vue-router'
|
import Router from 'vue-router'
|
||||||
import { generateUrl } from '@nextcloud/router'
|
import { getRootUrl, generateUrl } from '@nextcloud/router'
|
||||||
import MainView from '../views/MainView.vue'
|
import MainView from '../views/MainView.vue'
|
||||||
import NotFoundView from '../views/NotFoundView.vue'
|
import NotFoundView from '../views/NotFoundView.vue'
|
||||||
import WelcomeView from '../views/WelcomeView.vue'
|
import WelcomeView from '../views/WelcomeView.vue'
|
||||||
|
|
||||||
Vue.use(Router)
|
Vue.use(Router)
|
||||||
|
|
||||||
|
const webRootWithIndexPHP = getRootUrl() + '/index.php'
|
||||||
|
const doesURLContainIndexPHP = window.location.pathname.startsWith(webRootWithIndexPHP)
|
||||||
|
const base = generateUrl('/', {}, {
|
||||||
|
noRewrite: doesURLContainIndexPHP,
|
||||||
|
})
|
||||||
|
|
||||||
export default new Router({
|
export default new Router({
|
||||||
mode: 'history',
|
mode: 'history',
|
||||||
// if index.php is in the url AND we got this far, then it's working:
|
// if index.php is in the url AND we got this far, then it's working:
|
||||||
// let's keep using index.php in the url
|
// let's keep using index.php in the url
|
||||||
base: generateUrl('/', ''),
|
base,
|
||||||
linkActiveClass: 'active',
|
linkActiveClass: 'active',
|
||||||
routes: [
|
routes: [
|
||||||
{
|
{
|
||||||
|
|
Загрузка…
Ссылка в новой задаче