chore: update locale
This commit is contained in:
@@ -2,20 +2,20 @@ import type { UserInfo } from '@vben/types';
|
||||
|
||||
import type { UserApiType } from '../types';
|
||||
|
||||
import { request } from '#/forward';
|
||||
import { get, post } from '#/forward';
|
||||
|
||||
/**
|
||||
* 登录
|
||||
*/
|
||||
async function userLogin(data: UserApiType.LoginParams) {
|
||||
return request<UserApiType.LoginResult>('/login', { data, method: 'post' });
|
||||
return post<UserApiType.LoginResult>('/login', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户信息
|
||||
*/
|
||||
async function getUserInfo() {
|
||||
return request<UserInfo>('/getUserInfo', { method: 'get' });
|
||||
return get<UserInfo>('/getUserInfo');
|
||||
}
|
||||
|
||||
export { getUserInfo, userLogin };
|
||||
|
@@ -81,9 +81,9 @@ function setupRequestInterceptors(client: RequestClient) {
|
||||
);
|
||||
}
|
||||
|
||||
const { request } = createRequestClient();
|
||||
const { get, post, request } = createRequestClient();
|
||||
|
||||
// 其他配置的请求方法
|
||||
// const { request: xxxRequest } = createRequest();
|
||||
|
||||
export { request };
|
||||
export { get, post, request };
|
||||
|
235
apps/web-antd/src/router/routes/modules/demos.ts
Normal file
235
apps/web-antd/src/router/routes/modules/demos.ts
Normal file
@@ -0,0 +1,235 @@
|
||||
import type { RouteRecordRaw } from 'vue-router';
|
||||
|
||||
import { $t } from '@vben/locales/helper';
|
||||
|
||||
import { BasicLayout, IFrameView } from '#/layouts';
|
||||
|
||||
const routes: RouteRecordRaw[] = [
|
||||
{
|
||||
component: BasicLayout,
|
||||
meta: {
|
||||
icon: 'ic:baseline-view-in-ar',
|
||||
keepAlive: true,
|
||||
order: 1000,
|
||||
title: $t('page.demos.title'),
|
||||
},
|
||||
name: 'Demos',
|
||||
path: '/demos',
|
||||
redirect: '/demos/fallback/403',
|
||||
children: [
|
||||
{
|
||||
meta: {
|
||||
icon: 'mdi:lightbulb-error-outline',
|
||||
title: $t('page.demos.fallback.title'),
|
||||
},
|
||||
name: 'FallbackLayout',
|
||||
path: '/fallback',
|
||||
redirect: '/fallback/403',
|
||||
children: [
|
||||
{
|
||||
name: 'Fallback403',
|
||||
path: '403',
|
||||
component: () =>
|
||||
import('#/views/_essential/fallback/forbidden.vue'),
|
||||
meta: {
|
||||
icon: 'mdi:do-not-disturb-alt',
|
||||
title: '403',
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'Fallback404',
|
||||
path: '404',
|
||||
component: () =>
|
||||
import('#/views/_essential/fallback/not-found.vue'),
|
||||
meta: {
|
||||
icon: 'mdi:table-off',
|
||||
title: '404',
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'Fallback500',
|
||||
path: '500',
|
||||
component: () =>
|
||||
import('#/views/_essential/fallback/internal-error.vue'),
|
||||
meta: {
|
||||
icon: 'mdi:server-network-off',
|
||||
title: '500',
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'FallbackOffline',
|
||||
path: 'offline',
|
||||
component: () => import('#/views/_essential/fallback/offline.vue'),
|
||||
meta: {
|
||||
icon: 'mdi:offline',
|
||||
title: $t('fallback.offline'),
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
meta: {
|
||||
icon: 'ic:round-settings-input-composite',
|
||||
title: $t('page.demos.outside.title'),
|
||||
},
|
||||
name: 'Outside',
|
||||
path: '/outside',
|
||||
redirect: '/outside/iframe',
|
||||
children: [
|
||||
{
|
||||
name: 'iframe',
|
||||
path: 'iframe',
|
||||
meta: {
|
||||
icon: 'mdi:newspaper-variant-outline',
|
||||
title: $t('page.demos.outside.embedded'),
|
||||
},
|
||||
redirect: '/outside/iframe/vue-document',
|
||||
children: [
|
||||
{
|
||||
name: 'VueDocument',
|
||||
path: 'vue-document',
|
||||
component: IFrameView,
|
||||
meta: {
|
||||
icon: 'logos:vue',
|
||||
iframeSrc: 'https://cn.vuejs.org/',
|
||||
keepAlive: true,
|
||||
title: 'Vue',
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'Tailwindcss',
|
||||
path: 'tailwindcss',
|
||||
component: IFrameView,
|
||||
meta: {
|
||||
icon: 'devicon:tailwindcss',
|
||||
iframeSrc: 'https://tailwindcss.com/',
|
||||
// keepAlive: true,
|
||||
title: 'Tailwindcss',
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: 'ExternalLink',
|
||||
path: 'external-link',
|
||||
meta: {
|
||||
icon: 'mdi:newspaper-variant-multiple-outline',
|
||||
title: $t('page.demos.outside.external-link'),
|
||||
},
|
||||
redirect: '/outside/external-link/vite',
|
||||
children: [
|
||||
{
|
||||
name: 'Vite',
|
||||
path: 'vite',
|
||||
component: IFrameView,
|
||||
meta: {
|
||||
icon: 'logos:vitejs',
|
||||
link: 'https://vitejs.dev/',
|
||||
title: 'Vite',
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'VueUse',
|
||||
path: 'vue-use',
|
||||
component: IFrameView,
|
||||
meta: {
|
||||
icon: 'logos:vueuse',
|
||||
link: 'https://vueuse.org',
|
||||
title: 'VueUse',
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
meta: {
|
||||
icon: 'ic:round-menu',
|
||||
title: $t('page.demos.nested.title'),
|
||||
},
|
||||
name: 'Nested',
|
||||
path: 'nested',
|
||||
redirect: '/demos/nested/menu1',
|
||||
children: [
|
||||
{
|
||||
name: 'Menu1',
|
||||
path: 'menu1',
|
||||
component: () => import('#/views/demos/nested/menu-1.vue'),
|
||||
meta: {
|
||||
icon: 'ic:round-menu',
|
||||
keepAlive: true,
|
||||
title: $t('page.demos.nested.menu1'),
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'Menu2',
|
||||
path: 'menu2',
|
||||
meta: {
|
||||
icon: 'ic:round-menu',
|
||||
keepAlive: true,
|
||||
title: $t('page.demos.nested.menu2'),
|
||||
},
|
||||
redirect: '/nested/menu2/menu2-1',
|
||||
children: [
|
||||
{
|
||||
name: 'Menu21',
|
||||
path: 'menu2-1',
|
||||
component: () => import('#/views/demos/nested/menu-2-1.vue'),
|
||||
meta: {
|
||||
icon: 'ic:round-menu',
|
||||
keepAlive: true,
|
||||
title: $t('page.demos.nested.menu21'),
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: 'Menu3',
|
||||
path: 'menu3',
|
||||
meta: {
|
||||
icon: 'ic:round-menu',
|
||||
title: $t('page.demos.nested.menu3'),
|
||||
},
|
||||
redirect: '/nested/menu3/menu3-1',
|
||||
children: [
|
||||
{
|
||||
name: 'Menu31',
|
||||
path: 'menu3-1',
|
||||
component: () => import('#/views/demos/nested/menu-3-1.vue'),
|
||||
meta: {
|
||||
icon: 'ic:round-menu',
|
||||
keepAlive: true,
|
||||
title: $t('page.demos.nested.menu31'),
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'Menu32',
|
||||
path: 'menu3-2',
|
||||
meta: {
|
||||
icon: 'ic:round-menu',
|
||||
title: $t('page.demos.nested.menu32'),
|
||||
},
|
||||
redirect: '/nested/menu3/menu3-2/menu3-2-1',
|
||||
children: [
|
||||
{
|
||||
name: 'Menu321',
|
||||
path: 'menu3-2-1',
|
||||
component: () =>
|
||||
import('#/views/demos/nested/menu-3-2-1.vue'),
|
||||
meta: {
|
||||
icon: 'ic:round-menu',
|
||||
keepAlive: true,
|
||||
title: $t('page.demos.nested.menu321'),
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
export default routes;
|
@@ -1,59 +0,0 @@
|
||||
import type { RouteRecordRaw } from 'vue-router';
|
||||
|
||||
import { $t } from '@vben/locales/helper';
|
||||
|
||||
import { BasicLayout } from '#/layouts';
|
||||
|
||||
const routes: RouteRecordRaw[] = [
|
||||
{
|
||||
component: BasicLayout,
|
||||
meta: {
|
||||
icon: 'mdi:lightbulb-error-outline',
|
||||
title: $t('page.fallback.title'),
|
||||
},
|
||||
name: 'FallbackLayout',
|
||||
path: '/fallback',
|
||||
redirect: '/fallback/403',
|
||||
children: [
|
||||
{
|
||||
name: 'Fallback403',
|
||||
path: '403',
|
||||
component: () => import('#/views/_essential/fallback/forbidden.vue'),
|
||||
meta: {
|
||||
icon: 'mdi:do-not-disturb-alt',
|
||||
title: '403',
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'Fallback404',
|
||||
path: '404',
|
||||
component: () => import('#/views/_essential/fallback/not-found.vue'),
|
||||
meta: {
|
||||
icon: 'mdi:table-off',
|
||||
title: '404',
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'Fallback500',
|
||||
path: '500',
|
||||
component: () =>
|
||||
import('#/views/_essential/fallback/internal-error.vue'),
|
||||
meta: {
|
||||
icon: 'mdi:server-network-off',
|
||||
title: '500',
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'FallbackOffline',
|
||||
path: 'offline',
|
||||
component: () => import('#/views/_essential/fallback/offline.vue'),
|
||||
meta: {
|
||||
icon: 'mdi:offline',
|
||||
title: $t('fallback.offline'),
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
export default routes;
|
@@ -1,98 +0,0 @@
|
||||
import type { RouteRecordRaw } from 'vue-router';
|
||||
|
||||
import { $t } from '@vben/locales/helper';
|
||||
|
||||
import { BasicLayout } from '#/layouts';
|
||||
|
||||
const routes: RouteRecordRaw[] = [
|
||||
{
|
||||
component: BasicLayout,
|
||||
meta: {
|
||||
icon: 'ic:round-menu',
|
||||
keepAlive: true,
|
||||
order: 1000,
|
||||
title: $t('page.nested.title'),
|
||||
},
|
||||
name: 'Nested',
|
||||
path: '/nested',
|
||||
redirect: '/nested/menu1',
|
||||
children: [
|
||||
{
|
||||
name: 'Menu1',
|
||||
path: 'menu1',
|
||||
component: () => import('#/views/nested/menu-1.vue'),
|
||||
meta: {
|
||||
icon: 'ic:round-menu',
|
||||
keepAlive: true,
|
||||
title: $t('page.nested.menu1'),
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'Menu2',
|
||||
path: 'menu2',
|
||||
meta: {
|
||||
icon: 'ic:round-menu',
|
||||
keepAlive: true,
|
||||
title: $t('page.nested.menu2'),
|
||||
},
|
||||
redirect: '/nested/menu2/menu2-1',
|
||||
children: [
|
||||
{
|
||||
name: 'Menu21',
|
||||
path: 'menu2-1',
|
||||
component: () => import('#/views/nested/menu-2-1.vue'),
|
||||
meta: {
|
||||
icon: 'ic:round-menu',
|
||||
keepAlive: true,
|
||||
title: $t('page.nested.menu21'),
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: 'Menu3',
|
||||
path: 'menu3',
|
||||
meta: {
|
||||
icon: 'ic:round-menu',
|
||||
title: $t('page.nested.menu3'),
|
||||
},
|
||||
redirect: '/nested/menu3/menu3-1',
|
||||
children: [
|
||||
{
|
||||
name: 'Menu31',
|
||||
path: 'menu3-1',
|
||||
component: () => import('#/views/nested/menu-3-1.vue'),
|
||||
meta: {
|
||||
icon: 'ic:round-menu',
|
||||
keepAlive: true,
|
||||
title: $t('page.nested.menu31'),
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'Menu32',
|
||||
path: 'menu3-2',
|
||||
meta: {
|
||||
icon: 'ic:round-menu',
|
||||
title: $t('page.nested.menu32'),
|
||||
},
|
||||
redirect: '/nested/menu3/menu3-2/menu3-2-1',
|
||||
children: [
|
||||
{
|
||||
name: 'Menu321',
|
||||
path: 'menu3-2-1',
|
||||
component: () => import('#/views/nested/menu-3-2-1.vue'),
|
||||
meta: {
|
||||
icon: 'ic:round-menu',
|
||||
keepAlive: true,
|
||||
title: $t('page.nested.menu321'),
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
export default routes;
|
@@ -1,86 +0,0 @@
|
||||
import type { RouteRecordRaw } from 'vue-router';
|
||||
|
||||
import { $t } from '@vben/locales/helper';
|
||||
|
||||
import { BasicLayout, IFrameView } from '#/layouts';
|
||||
|
||||
const routes: RouteRecordRaw[] = [
|
||||
{
|
||||
component: BasicLayout,
|
||||
meta: {
|
||||
icon: 'ic:round-settings-input-composite',
|
||||
title: $t('page.outside.title'),
|
||||
},
|
||||
name: 'Outside',
|
||||
path: '/outside',
|
||||
redirect: '/outside/iframe',
|
||||
children: [
|
||||
{
|
||||
name: 'iframe',
|
||||
path: 'iframe',
|
||||
meta: {
|
||||
icon: 'mdi:newspaper-variant-outline',
|
||||
title: $t('page.outside.embedded'),
|
||||
},
|
||||
redirect: '/outside/iframe/vue-document',
|
||||
children: [
|
||||
{
|
||||
name: 'VueDocument',
|
||||
path: 'vue-document',
|
||||
component: IFrameView,
|
||||
meta: {
|
||||
icon: 'logos:vue',
|
||||
iframeSrc: 'https://cn.vuejs.org/',
|
||||
keepAlive: true,
|
||||
title: 'Vue',
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'Tailwindcss',
|
||||
path: 'tailwindcss',
|
||||
component: IFrameView,
|
||||
meta: {
|
||||
icon: 'devicon:tailwindcss',
|
||||
iframeSrc: 'https://tailwindcss.com/',
|
||||
// keepAlive: true,
|
||||
title: 'Tailwindcss',
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: 'ExternalLink',
|
||||
path: 'external-link',
|
||||
meta: {
|
||||
icon: 'mdi:newspaper-variant-multiple-outline',
|
||||
title: $t('page.outside.external-link'),
|
||||
},
|
||||
redirect: '/outside/external-link/vite',
|
||||
children: [
|
||||
{
|
||||
name: 'Vite',
|
||||
path: 'vite',
|
||||
component: IFrameView,
|
||||
meta: {
|
||||
icon: 'logos:vitejs',
|
||||
link: 'https://vitejs.dev/',
|
||||
title: 'Vite',
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'VueUse',
|
||||
path: 'vue-use',
|
||||
component: IFrameView,
|
||||
meta: {
|
||||
icon: 'logos:vueuse',
|
||||
link: 'https://vueuse.org',
|
||||
title: 'VueUse',
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
export default routes;
|
@@ -10,9 +10,10 @@ const routes: RouteRecordRaw[] = [
|
||||
{
|
||||
component: BasicLayout,
|
||||
meta: {
|
||||
badgeType: 'dot',
|
||||
icon: VBEN_LOGO,
|
||||
order: 9999,
|
||||
title: 'Vben',
|
||||
title: 'Vben Admin',
|
||||
},
|
||||
name: 'AboutLayout',
|
||||
path: '/vben-admin',
|
||||
@@ -23,6 +24,7 @@ const routes: RouteRecordRaw[] = [
|
||||
path: 'about',
|
||||
component: () => import('#/views/_essential/vben/about/index.vue'),
|
||||
meta: {
|
||||
badgeType: 'dot',
|
||||
icon: 'mdi:creative-commons',
|
||||
title: $t('page.vben.about'),
|
||||
},
|
||||
|
@@ -3,5 +3,5 @@ import { Fallback } from '@vben/universal-ui';
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Fallback status="hello" />
|
||||
<Fallback status="comming-soon" />
|
||||
</template>
|
||||
|
@@ -5,5 +5,5 @@ defineOptions({ name: 'Menu1' });
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Fallback status="hello" />
|
||||
<Fallback status="comming-soon" />
|
||||
</template>
|
@@ -5,5 +5,5 @@ defineOptions({ name: 'Menu21' });
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Fallback status="hello" />
|
||||
<Fallback status="comming-soon" />
|
||||
</template>
|
@@ -5,5 +5,5 @@ defineOptions({ name: 'Menu31' });
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Fallback status="hello" />
|
||||
<Fallback status="comming-soon" />
|
||||
</template>
|
@@ -5,5 +5,5 @@ defineOptions({ name: 'Menu321' });
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Fallback status="hello" />
|
||||
<Fallback status="comming-soon" />
|
||||
</template>
|
@@ -3,8 +3,8 @@ import { defineConfig } from '@vben/vite-config';
|
||||
export default defineConfig({
|
||||
application: ({ mode }) => {
|
||||
return {
|
||||
compress: true,
|
||||
compressTypes: ['brotli', 'gzip'],
|
||||
compress: false,
|
||||
compressTypes: ['brotli', 'gzip'] as const,
|
||||
importmap: false,
|
||||
importmapOptions: {
|
||||
// 通过 Importmap CDN 方式引入,
|
||||
|
Reference in New Issue
Block a user