mirror of https://github.com/Bubka/2FAuth.git
Fix missing subdirectory support - Fixes #262
This commit is contained in:
parent
e3ded669ca
commit
5fd7f43968
|
@ -12,7 +12,7 @@ import noRegistration from './middlewares/noRegistration'
|
||||||
import setReturnTo from './middlewares/setReturnTo'
|
import setReturnTo from './middlewares/setReturnTo'
|
||||||
|
|
||||||
const router = createRouter({
|
const router = createRouter({
|
||||||
history: createWebHistory('/'),
|
history: createWebHistory(window.appConfig.subdirectory ? window.appConfig.subdirectory : '/'),
|
||||||
routes: [
|
routes: [
|
||||||
{ path: '/start', name: 'start', component: () => import('../views/Start.vue'), meta: { middlewares: [authGuard, setReturnTo], watchedByKicker: true } },
|
{ 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 } },
|
{ path: '/capture', name: 'capture', component: () => import('../views/twofaccounts/Capture.vue'), meta: { middlewares: [authGuard, setReturnTo], watchedByKicker: true } },
|
||||||
|
|
|
@ -4,11 +4,12 @@ import { useNotifyStore } from '@/stores/notify'
|
||||||
|
|
||||||
export const httpClientFactory = (endpoint = 'api') => {
|
export const httpClientFactory = (endpoint = 'api') => {
|
||||||
let baseURL
|
let baseURL
|
||||||
|
const subdir = window.appConfig.subdirectory
|
||||||
|
|
||||||
if (endpoint === 'web') {
|
if (endpoint === 'web') {
|
||||||
baseURL = '/'
|
baseURL = subdir + '/'
|
||||||
} else {
|
} else {
|
||||||
baseURL = '/api/v1'
|
baseURL = subdir + '/api/v1'
|
||||||
}
|
}
|
||||||
|
|
||||||
const httpClient = axios.create({
|
const httpClient = axios.create({
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
<link rel="icon" type="image/png" href="{{ asset('favicon.png') }}" />
|
<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" href="{{ asset('favicon_lg.png') }}" />
|
||||||
<link rel="apple-touch-icon-precomposed" 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>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
|
@ -5,7 +5,10 @@ import i18n from 'laravel-vue-i18n/vite'
|
||||||
import AutoImport from 'unplugin-auto-import/vite'
|
import AutoImport from 'unplugin-auto-import/vite'
|
||||||
import version from './vite.version'
|
import version from './vite.version'
|
||||||
|
|
||||||
|
const ASSET_URL = process.env.ASSET_URL || ''
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
|
base: `${ASSET_URL}`,
|
||||||
plugins: [
|
plugins: [
|
||||||
laravel([
|
laravel([
|
||||||
'resources/js/app.js',
|
'resources/js/app.js',
|
||||||
|
|
Loading…
Reference in New Issue