route(`admin.activities.${name}`, params)
const viewTo = ({ name = '', params = {}, query = {} }) => view({ name: `admin.activities.${name}`, params, query })
// Obtener traducción del componente
-const transl = (str) => lang(`activities.${str}`)
+const transl = (str) => lang(`admin.activity.${str}`)
// Determina si un usuario puede hacer algo no en base a los permisos
const can = (permission) => hasPermission(`activities.${permission}`)
diff --git a/src/pages/Admin/Roles/Index.vue b/src/pages/Admin/Roles/Index.vue
index 8f54b34..a21334f 100644
--- a/src/pages/Admin/Roles/Index.vue
+++ b/src/pages/Admin/Roles/Index.vue
@@ -1,6 +1,6 @@
@@ -62,7 +67,7 @@ onMounted(() => {
{{ $t('auth.forgotPassword.ask') }}
diff --git a/src/pages/Auth/Module.js b/src/pages/Auth/Module.js
new file mode 100644
index 0000000..8c231e1
--- /dev/null
+++ b/src/pages/Auth/Module.js
@@ -0,0 +1,17 @@
+
+import { lang } from '@Lang/i18n';
+
+// Ruta API
+const apiTo = (name, params = {}) => route(`auth.${name}`, params)
+
+// Ruta visual
+const viewTo = ({ name = '', params = {}, query = {} }) => view({ name: `auth.${name}`, params, query })
+
+// Obtener traducción del componente
+const transl = (str) => lang(`auth.${str}`)
+
+export {
+ viewTo,
+ apiTo,
+ transl
+}
\ No newline at end of file
diff --git a/src/pages/Auth/ResetPassword.vue b/src/pages/Auth/ResetPassword.vue
index 23f88c5..c246b88 100644
--- a/src/pages/Auth/ResetPassword.vue
+++ b/src/pages/Auth/ResetPassword.vue
@@ -2,7 +2,7 @@
import { onMounted, ref } from 'vue';
import { useRoute, useRouter } from 'vue-router';
import { useForm } from '@Services/Api.js'
-
+import { viewTo } from './Module';
import PrimaryButton from '@Holos/Button/Primary.vue';
import Input from '@Holos/Form/InputWithIcon.vue'
@@ -24,21 +24,17 @@ const submit = () => {
form.post(route('auth.reset-password'), {
onSuccess: () => {
Notify.success(Lang('auth.reset.success'));
- router.push({ name: 'index' })
+ router.push(viewTo({ name: 'index' }));
},
onError: () => {
- router.push({ name: 'index' });
+ router.push(viewTo({ name: 'index' }));
}
});
};
onMounted(() => {
- console.log('mount')
-
form.token = vroute.query.token;
email.value = vroute.query.email;
-
- // router.replace({ query: {} });
})
diff --git a/src/pages/Changelogs/App.vue b/src/pages/Changelogs/App.vue
index b96052d..6c70d2c 100644
--- a/src/pages/Changelogs/App.vue
+++ b/src/pages/Changelogs/App.vue
@@ -71,7 +71,28 @@ const changelogs = [
'ADD: Visualización de historial de cambios del backend.',
],
date: '2025-01-17'
- }
+ },
+ {
+ version: '0.9.8',
+ details: [
+ 'UPDATE: Actualización de dependencias.',
+ 'UPDATE: TailwindCSS 3 => 4.',
+ 'UPDATE: Actualización de Diseño, mejoras visuales.',
+ ],
+ date: '2025-03-04'
+ },
+ {
+ version: '0.9.9',
+ details: [
+ 'FIX: Obtención de recursos de backend mediante `api.resource`.',
+ 'FIX: Títulos de modal de eliminación ahora son editables.',
+ 'UPDATE: Simplificación de las rutas de autenticación.',
+ 'UPDATE: Traducciones modulares faltantes.',
+ 'UPDATE: Ahora las plantillas se definen en el grupo de rutas, y se heredan en las rutas hijas.',
+ 'ADD: Función creación de URL a backend fuera de VUEJS.',
+ ],
+ date: '2025-03-13'
+ },
]
diff --git a/src/router/Auth.js b/src/router/Auth.js
deleted file mode 100644
index 940316e..0000000
--- a/src/router/Auth.js
+++ /dev/null
@@ -1,24 +0,0 @@
-import { createRouter, createWebHashHistory } from 'vue-router'
-
-const router = createRouter({
- history: createWebHashHistory(import.meta.env.BASE_URL),
- routes: [
- {
- path: '/',
- name: 'index',
- component: () => import('@Pages/Auth/Login.vue')
- },
- {
- path: '/forgot-password',
- name: 'forgot-password',
- component: () => import('@Pages/Auth/ForgotPassword.vue')
- },
- {
- path: '/reset-password',
- name: 'reset-password',
- component: () => import('@Pages/Auth/ResetPassword.vue')
- }
- ]
-})
-
-export default router
diff --git a/src/router/Index.js b/src/router/Index.js
index 24e206f..5fcdcb2 100644
--- a/src/router/Index.js
+++ b/src/router/Index.js
@@ -16,6 +16,7 @@ const router = createRouter({
routes: [
{
path: '/',
+ component: () => import('@Layouts/AppLayout.vue'),
children: [
{
path: '',
@@ -51,6 +52,7 @@ const router = createRouter({
},
{
path: '/admin',
+ component: () => import('@Layouts/AppLayout.vue'),
children: [
{
path: 'users',
@@ -119,7 +121,7 @@ const router = createRouter({
},
{
path: '/changelogs',
- name: 'changelogs',
+ component: () => import('@Layouts/AppLayout.vue'),
children: [
{
path: '',
@@ -133,6 +135,27 @@ const router = createRouter({
}
]
},
+ {
+ path: '/auth',
+ component: () => import('@Holos/Layout/Auth.vue'),
+ children: [
+ {
+ path: '',
+ name: 'auth.index',
+ component: () => import('@Pages/Auth/Login.vue')
+ },
+ {
+ path: 'forgot-password',
+ name: 'auth.forgot-password',
+ component: () => import('@Pages/Auth/ForgotPassword.vue')
+ },
+ {
+ path: 'reset-password',
+ name: 'auth.reset-password',
+ component: () => import('@Pages/Auth/ResetPassword.vue')
+ }
+ ]
+ },
{
path: '/:pathMatch(.*)*',
name: '404',
diff --git a/src/services/Api.js b/src/services/Api.js
index c19fc58..673eeb1 100644
--- a/src/services/Api.js
+++ b/src/services/Api.js
@@ -73,8 +73,6 @@ const closeSession = () => {
resetCsrfToken()
Notify.info(Lang('session.closed'))
-
- location.replace('auth.html')
}
/**
@@ -86,6 +84,13 @@ function composeKey(parent, key) {
return parent ? parent + '[' + key + ']' : key
}
+/**
+ * URL API
+ */
+const apiURL = (path) => {
+ return import.meta.env.VITE_API_URL + '/api/' + path
+}
+
/**
* Instancia de la API de uso directo
*/
@@ -135,8 +140,6 @@ const api = {
if(options.hasOwnProperty('onFail')) {
options.onFail(data.data);
}
-
- console.log(data.data);
}
if(options.hasOwnProperty('onFinish')) {
@@ -214,7 +217,7 @@ const api = {
})
},
resource(resources, options) {
- this.post('resources/get', {
+ this.post(apiURL('resources/get'), {
...options,
data: resources
})
@@ -569,6 +572,7 @@ const useSearcher = (options = {
export {
api,
token,
+ apiURL,
closeSession,
defineCsrfToken,
defineApiToken,
diff --git a/src/services/Page.js b/src/services/Page.js
index 0097752..a0ec9ff 100644
--- a/src/services/Page.js
+++ b/src/services/Page.js
@@ -110,6 +110,8 @@ const logout = () => {
onSuccess: (r) => {
if(r.is_revoked === true) {
closeSession()
+
+ location.replace('/')
}
}
});
diff --git a/vite.config.js b/vite.config.js
index b35614e..d570e01 100644
--- a/vite.config.js
+++ b/vite.config.js
@@ -7,14 +7,6 @@ import vue from '@vitejs/plugin-vue'
// https://vite.dev/config/
export default defineConfig({
plugins: [vue(), tailwindcss()],
- build: {
- rollupOptions: {
- input: {
- main: './index.html', // Ruta al archivo index.html
- auth: './auth.html', // Ruta al archivo auth.html
- },
- },
- },
server: {
allowedHosts: true,
},