Skip to content

pr #6321

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 5 commits into from
Closed

pr #6321

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 4 additions & 4 deletions apps/backend-mock/utils/mock-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ export const MOCK_USERS: UserInfo[] = [
{
id: 2,
password: '123456',
realName: 'Jack',
realName: 'Test',
roles: ['user'],
username: 'jack',
username: 'test',
homePath: '/analytics',
},
];
Expand All @@ -47,7 +47,7 @@ export const MOCK_CODES = [
{
// user
codes: ['AC_1000001', 'AC_1000002'],
username: 'jack',
username: 'test',
},
];

Expand Down Expand Up @@ -182,7 +182,7 @@ export const MOCK_MENUS = [
},
{
menus: [...dashboardMenus, ...createDemosMenus('user')],
username: 'jack',
username: 'test',
},
];

Expand Down
6 changes: 3 additions & 3 deletions apps/web-antd/.env
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# 应用标题
VITE_APP_TITLE=Vben Admin Antd
VITE_APP_TITLE=管理后台

# 应用命名空间,用于缓存、store等功能的前缀,确保隔离
VITE_APP_NAMESPACE=vben-web-antd
VITE_APP_NAMESPACE=vben-web-antd-admin

# 对store进行加密的密钥,在将store持久化到localStorage时会使用该密钥进行加密
VITE_APP_STORE_SECURE_KEY=please-replace-me-with-your-own-key
VITE_APP_STORE_SECURE_KEY=vben-web-antd-admin
3 changes: 2 additions & 1 deletion apps/web-antd/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
},
"type": "module",
"scripts": {
"build": "pnpm vite build --mode production",
"build:prod": "pnpm vite build --mode production",
"build:test": "pnpm vite build --mode test",
"build:analyze": "pnpm vite build --mode analyze",
"dev": "pnpm vite --mode development",
"preview": "vite preview",
Expand Down
Binary file added apps/web-antd/public/static/avatar_default.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/web-antd/public/static/login_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/web-antd/public/static/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/web-antd/public/static/sd.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/web-antd/public/static/slogan.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 10 additions & 6 deletions apps/web-antd/src/layouts/auth.vue
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
<script lang="ts" setup>
import { computed } from 'vue';
// import { computed } from 'vue';

import { AuthPageLayout } from '@vben/layouts';
import { preferences } from '@vben/preferences';
// import { preferences } from '@vben/preferences';

import { $t } from '#/locales';

const appName = computed(() => preferences.app.name);
const logo = computed(() => preferences.logo.source);
import sloganImg from '/static/slogan.jpg';
// const appName = computed(() => preferences.app.name);
// const logo = computed(() => preferences.logo.source);
</script>

<template>
<AuthPageLayout
:app-name="appName"
:logo="logo"
:copyright="true"
:toolbar="false"
app-name=""
logo=""
:slogan-image="sloganImg"
:page-description="$t('authentication.pageDesc')"
:page-title="$t('authentication.pageTitle')"
>
Expand Down
58 changes: 27 additions & 31 deletions apps/web-antd/src/layouts/basic.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ import type { NotificationItem } from '@vben/layouts';
import { computed, ref, watch } from 'vue';

import { AuthenticationLoginExpiredModal } from '@vben/common-ui';
import { VBEN_DOC_URL, VBEN_GITHUB_URL } from '@vben/constants';
import { useWatermark } from '@vben/hooks';
import { BookOpenText, CircleHelp, MdiGithub } from '@vben/icons';
import {
BasicLayout,
LockScreen,
Expand All @@ -15,9 +13,7 @@ import {
} from '@vben/layouts';
import { preferences } from '@vben/preferences';
import { useAccessStore, useUserStore } from '@vben/stores';
import { openWindow } from '@vben/utils';

import { $t } from '#/locales';
import { useAuthStore } from '#/store';
import LoginForm from '#/views/_core/authentication/login.vue';

Expand Down Expand Up @@ -61,33 +57,33 @@ const showDot = computed(() =>
);

const menus = computed(() => [
{
handler: () => {
openWindow(VBEN_DOC_URL, {
target: '_blank',
});
},
icon: BookOpenText,
text: $t('ui.widgets.document'),
},
{
handler: () => {
openWindow(VBEN_GITHUB_URL, {
target: '_blank',
});
},
icon: MdiGithub,
text: 'GitHub',
},
{
handler: () => {
openWindow(`${VBEN_GITHUB_URL}/issues`, {
target: '_blank',
});
},
icon: CircleHelp,
text: $t('ui.widgets.qa'),
},
// {
// handler: () => {
// openWindow(VBEN_DOC_URL, {
// target: '_blank',
// });
// },
// icon: BookOpenText,
// text: $t('ui.widgets.document'),
// },
// {
// handler: () => {
// openWindow(VBEN_GITHUB_URL, {
// target: '_blank',
// });
// },
// icon: MdiGithub,
// text: 'GitHub',
// },
// {
// handler: () => {
// openWindow(`${VBEN_GITHUB_URL}/issues`, {
// target: '_blank',
// });
// },
// icon: CircleHelp,
// text: $t('ui.widgets.qa'),
// },
]);

const avatar = computed(() => {
Expand Down
30 changes: 30 additions & 0 deletions apps/web-antd/src/preferences.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { defineOverridesPreferences } from '@vben/preferences';

import defaultAvatarImg from '/static/avatar_default.png';
/**
* @description 项目配置文件
* 只需要覆盖项目中的一部分配置,不需要的配置不用覆盖,会自动使用默认配置
Expand All @@ -9,5 +10,34 @@ export const overridesPreferences = defineOverridesPreferences({
// overrides
app: {
name: import.meta.env.VITE_APP_TITLE,
defaultHomePath: '/test3',
enablePreferences: false,
enableCheckUpdates: false,
watermark: false,
defaultAvatar: defaultAvatarImg,
},
theme: {
mode: 'light',
colorPrimary: 'hsl(222 100% 54%)',
},
widget: {
languageToggle: false,
fullscreen: false,
globalSearch: false,
lockScreen: false,
notification: false,
refresh: false,
sidebarToggle: true,
themeToggle: false,
},
footer: {
enable: true,
fixed: true,
},
tabbar: {
enable: false,
},
shortcutKeys: {
enable: false,
},
});
18 changes: 9 additions & 9 deletions apps/web-antd/src/router/routes/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,15 @@ const coreRoutes: RouteRecordRaw[] = [
title: $t('page.auth.codeLogin'),
},
},
{
name: 'QrCodeLogin',
path: 'qrcode-login',
component: () =>
import('#/views/_core/authentication/qrcode-login.vue'),
meta: {
title: $t('page.auth.qrcodeLogin'),
},
},
// {
// name: 'QrCodeLogin',
// path: 'qrcode-login',
// component: () =>
// import('#/views/_core/authentication/qrcode-login.vue'),
// meta: {
// title: $t('page.auth.qrcodeLogin'),
// },
// },
{
name: 'ForgetPassword',
path: 'forget-password',
Expand Down
12 changes: 11 additions & 1 deletion apps/web-antd/src/router/routes/modules/dashboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const routes: RouteRecordRaw[] = [
path: '/analytics',
component: () => import('#/views/dashboard/analytics/index.vue'),
meta: {
affixTab: true,
// affixTab: true,
icon: 'lucide:area-chart',
title: $t('page.dashboard.analytics'),
},
Expand All @@ -33,6 +33,16 @@ const routes: RouteRecordRaw[] = [
},
],
},
{
name: 'test3',
path: '/test3',
component: () => import('#/views/dashboard/analytics/index.vue'),
meta: {
// affixTab: true,
icon: 'lucide:area-chart',
title: $t('page.dashboard.analytics'),
},
},
];

export default routes;
42 changes: 21 additions & 21 deletions apps/web-antd/src/router/routes/modules/demos.ts
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
import type { RouteRecordRaw } from 'vue-router';

import { $t } from '#/locales';
// import { $t } from '#/locales';

const routes: RouteRecordRaw[] = [
{
meta: {
icon: 'ic:baseline-view-in-ar',
keepAlive: true,
order: 1000,
title: $t('demos.title'),
},
name: 'Demos',
path: '/demos',
children: [
{
meta: {
title: $t('demos.antd'),
},
name: 'AntDesignDemos',
path: '/demos/ant-design',
component: () => import('#/views/demos/antd/index.vue'),
},
],
},
// {
// meta: {
// icon: 'ic:baseline-view-in-ar',
// keepAlive: true,
// order: 1000,
// title: $t('demos.title'),
// },
// name: 'Demos',
// path: '/demos',
// children: [
// {
// meta: {
// title: $t('demos.antd'),
// },
// name: 'AntDesignDemos',
// path: '/demos/ant-design',
// component: () => import('#/views/demos/antd/index.vue'),
// },
// ],
// },
];

export default routes;
Loading
Loading