fix: refs #7826 init
This commit is contained in:
parent
a6adec0407
commit
31a5dd653c
|
@ -0,0 +1,6 @@
|
||||||
|
export default [
|
||||||
|
{
|
||||||
|
path: '/api',
|
||||||
|
rule: { target: 'http://0.0.0.0:3000' },
|
||||||
|
},
|
||||||
|
];
|
|
@ -55,7 +55,6 @@ export default configure(function (/* ctx */) {
|
||||||
browser: ['es2022', 'edge88', 'firefox78', 'chrome87', 'safari13.1'],
|
browser: ['es2022', 'edge88', 'firefox78', 'chrome87', 'safari13.1'],
|
||||||
node: 'node18',
|
node: 'node18',
|
||||||
},
|
},
|
||||||
|
|
||||||
vueRouterMode: 'hash', // available values: 'hash', 'history'
|
vueRouterMode: 'hash', // available values: 'hash', 'history'
|
||||||
// vueRouterBase,
|
// vueRouterBase,
|
||||||
// vueDevtools,
|
// vueDevtools,
|
||||||
|
@ -68,6 +67,12 @@ export default configure(function (/* ctx */) {
|
||||||
// env: {},
|
// env: {},
|
||||||
rawDefine: {
|
rawDefine: {
|
||||||
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV),
|
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV),
|
||||||
|
'process.env.BUILD_VERSION': JSON.stringify(
|
||||||
|
new Date()
|
||||||
|
.toISOString()
|
||||||
|
.replace(/[-:T.]/g, '')
|
||||||
|
.slice(0, 14),
|
||||||
|
), // Versión con marca de tiempo
|
||||||
},
|
},
|
||||||
// ignorePublicFolder: true,
|
// ignorePublicFolder: true,
|
||||||
// minify: false,
|
// minify: false,
|
||||||
|
@ -179,7 +184,6 @@ export default configure(function (/* ctx */) {
|
||||||
'render', // keep this as last one
|
'render', // keep this as last one
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|
||||||
// https://v2.quasar.dev/quasar-cli/developing-pwa/configuring-pwa
|
// https://v2.quasar.dev/quasar-cli/developing-pwa/configuring-pwa
|
||||||
pwa: {
|
pwa: {
|
||||||
workboxMode: 'generateSW', // or 'injectManifest'
|
workboxMode: 'generateSW', // or 'injectManifest'
|
||||||
|
|
|
@ -34,9 +34,11 @@ quasar.iconMapFn = (iconName) => {
|
||||||
content: iconName,
|
content: iconName,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
const env = process.env.BUILD_VERSION;
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
<meta name="app-version" :content="env" />
|
||||||
<RouterView />
|
<RouterView />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,11 @@ import { useCau } from 'src/composables/useCau';
|
||||||
export default boot(({ app }) => {
|
export default boot(({ app }) => {
|
||||||
QForm.mixins = [qFormMixin];
|
QForm.mixins = [qFormMixin];
|
||||||
QLayout.mixins = [mainShortcutMixin];
|
QLayout.mixins = [mainShortcutMixin];
|
||||||
|
const metaVersion = process.env.BUILD_VERSION;
|
||||||
|
const storedVersion = localStorage.getItem('appVersion');
|
||||||
|
if (metaVersion !== storedVersion) {
|
||||||
|
localStorage.setItem('appVersion', metaVersion);
|
||||||
|
}
|
||||||
app.directive('shortcut', keyShortcut);
|
app.directive('shortcut', keyShortcut);
|
||||||
app.config.errorHandler = async (error) => {
|
app.config.errorHandler = async (error) => {
|
||||||
let message;
|
let message;
|
||||||
|
|
|
@ -14,6 +14,7 @@ import { useTokenConfig } from 'src/composables/useTokenConfig';
|
||||||
import { useAcl } from 'src/composables/useAcl';
|
import { useAcl } from 'src/composables/useAcl';
|
||||||
import { isLoggedIn } from 'src/utils/session';
|
import { isLoggedIn } from 'src/utils/session';
|
||||||
import { useSession } from 'src/composables/useSession';
|
import { useSession } from 'src/composables/useSession';
|
||||||
|
import { Notify } from 'quasar';
|
||||||
|
|
||||||
let session = null;
|
let session = null;
|
||||||
const { t, te } = i18n.global;
|
const { t, te } = i18n.global;
|
||||||
|
@ -103,5 +104,17 @@ export default defineRouter(function (/* { store, ssrContext } */) {
|
||||||
document.title = title;
|
document.title = title;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Router.onError((error, to) => {
|
||||||
|
if (
|
||||||
|
error.message.includes('Failed to fetch dynamically imported module') ||
|
||||||
|
error.message.includes('Importing a module script failed')
|
||||||
|
)
|
||||||
|
Notify.create({
|
||||||
|
message: t('globals.noSelectedRows'),
|
||||||
|
type: 'negative',
|
||||||
|
timeout: 5000,
|
||||||
|
progress: true,
|
||||||
|
});
|
||||||
|
});
|
||||||
return Router;
|
return Router;
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue