Fix missing subdirectory support - Fixes #262

This commit is contained in:
Bubka 2023-12-29 00:21:52 +01:00
parent e3ded669ca
commit 5fd7f43968
4 changed files with 8 additions and 4 deletions

View File

@ -12,7 +12,7 @@ import noRegistration from './middlewares/noRegistration'
import setReturnTo from './middlewares/setReturnTo'
const router = createRouter({
history: createWebHistory('/'),
history: createWebHistory(window.appConfig.subdirectory ? window.appConfig.subdirectory : '/'),
routes: [
{ path: '/start', name: 'start', component: () => import('../views/Start.vue'), meta: { middlewares: [authGuard, setReturnTo], watchedByKicker: true } },
{ path: '/capture', name: 'capture', component: () => import('../views/twofaccounts/Capture.vue'), meta: { middlewares: [authGuard, setReturnTo], watchedByKicker: true } },

View File

@ -4,11 +4,12 @@ import { useNotifyStore } from '@/stores/notify'
export const httpClientFactory = (endpoint = 'api') => {
let baseURL
const subdir = window.appConfig.subdirectory
if (endpoint === 'web') {
baseURL = '/'
baseURL = subdir + '/'
} else {
baseURL = '/api/v1'
baseURL = subdir + '/api/v1'
}
const httpClient = axios.create({

View File

@ -15,7 +15,7 @@
<link rel="icon" type="image/png" href="{{ asset('favicon.png') }}" />
<link rel="apple-touch-icon" href="{{ asset('favicon_lg.png') }}" />
<link rel="apple-touch-icon-precomposed" href="{{ asset('favicon_lg.png') }}" />
<link rel="manifest" href="/manifest.json">
<link rel="manifest" href="{{ asset('manifest.json') }}">
</head>
<body>

3
vite.config.js vendored
View File

@ -5,7 +5,10 @@ import i18n from 'laravel-vue-i18n/vite'
import AutoImport from 'unplugin-auto-import/vite'
import version from './vite.version'
const ASSET_URL = process.env.ASSET_URL || ''
export default defineConfig({
base: `${ASSET_URL}`,
plugins: [
laravel([
'resources/js/app.js',