fix(admin): 收敛环境配置和认证页

This commit is contained in:
sunlei 2026-06-02 07:34:57 +08:00
parent 99aa4a1fe7
commit 7cacedecc0
10 changed files with 56 additions and 81 deletions

6
.gitignore vendored
View File

@ -24,6 +24,12 @@ package-lock.json
**/backend-mock/data **/backend-mock/data
# local env files # local env files
.env
.env.*
apps/*/.env
apps/*/.env.*
!.env.example
!apps/*/.env.example
.env.local .env.local
.env.*.local .env.*.local
.eslintcache .eslintcache

View File

@ -1,8 +0,0 @@
# 应用标题
VITE_APP_TITLE=Vben Admin Antdv Next
# 应用命名空间用于缓存、store等功能的前缀确保隔离
VITE_APP_NAMESPACE=vben-web-antdv-next
# 对store进行加密的密钥在将store持久化到localStorage时会使用该密钥进行加密
VITE_APP_STORE_SECURE_KEY=please-replace-me-with-your-own-key

View File

@ -1,7 +0,0 @@
# public path
VITE_BASE=/
# Basic interface address SPA
VITE_GLOB_API_URL=/api
VITE_VISUALIZER=true

View File

@ -1,17 +0,0 @@
# 端口号
VITE_PORT=5999
VITE_BASE=/
VITE_ROUTER_HISTORY=hash
# 接口地址
VITE_GLOB_API_URL=/api
# 是否开启 Nitro Mock服务true 为开启false 为关闭
VITE_NITRO_MOCK=false
# 是否打开 devtoolstrue 为打开false 为关闭
VITE_DEVTOOLS=false
# 是否注入全局loading
VITE_INJECT_APP_LOADING=true

View File

@ -0,0 +1,41 @@
# 应用标题
VITE_APP_TITLE=Vben Admin Antdv Next
# 应用命名空间用于缓存、store 等功能的前缀,确保隔离
VITE_APP_NAMESPACE=vben-web-antdv-next
# 本地开发端口
VITE_PORT=5999
# 基础路径
VITE_BASE=/
# 后端 API 前缀
VITE_GLOB_API_URL=/api
# vue-router 模式,可选 hash / html5
VITE_ROUTER_HISTORY=hash
# 是否开启 Nitro Mock 服务
VITE_NITRO_MOCK=false
# 是否打开 devtools
VITE_DEVTOOLS=false
# 是否注入全局 loading
VITE_INJECT_APP_LOADING=true
# 是否开启压缩,可以设置为 none, brotli, gzip
VITE_COMPRESS=none
# 是否开启 PWA
VITE_PWA=false
# 打包后是否生成 dist.zip
VITE_ARCHIVER=true
# 构建分析开关
VITE_VISUALIZER=false
# store 持久化加密密钥;真实值仅写入本地 .env不提交仓库
VITE_APP_STORE_SECURE_KEY=

View File

@ -1,19 +0,0 @@
VITE_BASE=/
# 接口地址
VITE_GLOB_API_URL=/api
# 是否开启压缩,可以设置为 none, brotli, gzip
VITE_COMPRESS=none
# 是否开启 PWA
VITE_PWA=false
# vue-router 的模式
VITE_ROUTER_HISTORY=hash
# 是否注入全局loading
VITE_INJECT_APP_LOADING=true
# 打包后是否生成dist.zip
VITE_ARCHIVER=true

View File

@ -1,6 +1,5 @@
<script lang="ts" setup> <script lang="ts" setup>
import type { VbenFormSchema } from '@vben/common-ui'; import type { VbenFormSchema } from '@vben/common-ui';
import type { Recordable } from '@vben/types';
import { computed, ref, useTemplateRef } from 'vue'; import { computed, ref, useTemplateRef } from 'vue';
@ -91,11 +90,10 @@ const formSchema = computed((): VbenFormSchema[] => {
/** /**
* 异步处理登录操作 * 异步处理登录操作
* Asynchronously handle the login process * Asynchronously handle the login process
* @param values 登录表单数据
*/ */
async function handleLogin(values: Recordable<any>) { async function handleLogin() {
// eslint-disable-next-line no-console loading.value = true;
console.log(values); loading.value = false;
} }
</script> </script>

View File

@ -27,9 +27,9 @@ const formSchema = computed((): VbenFormSchema[] => {
]; ];
}); });
function handleSubmit(value: Record<string, any>) { function handleSubmit() {
// eslint-disable-next-line no-console loading.value = true;
console.log('reset email:', value); loading.value = false;
} }
</script> </script>

View File

@ -32,23 +32,6 @@ const formSchema = computed((): VbenFormSchema[] => {
return [ return [
{ {
component: 'VbenSelect', component: 'VbenSelect',
// componentProps(_values, form) {
// return {
// 'onUpdate:modelValue': (value: string) => {
// const findItem = MOCK_USER_OPTIONS.find(
// (item) => item.value === value,
// );
// if (findItem) {
// form.setValues({
// password: '123456',
// username: findItem.label,
// });
// }
// },
// options: MOCK_USER_OPTIONS,
// placeholder: $t('authentication.selectAccount'),
// };
// },
componentProps: { componentProps: {
options: MOCK_USER_OPTIONS, options: MOCK_USER_OPTIONS,
placeholder: $t('authentication.selectAccount'), placeholder: $t('authentication.selectAccount'),
@ -74,7 +57,6 @@ const formSchema = computed((): VbenFormSchema[] => {
); );
if (findUser) { if (findUser) {
form.setValues({ form.setValues({
password: '123456',
username: findUser.value, username: findUser.value,
}); });
} }

View File

@ -1,6 +1,5 @@
<script lang="ts" setup> <script lang="ts" setup>
import type { VbenFormSchema } from '@vben/common-ui'; import type { VbenFormSchema } from '@vben/common-ui';
import type { Recordable } from '@vben/types';
import { computed, h, ref } from 'vue'; import { computed, h, ref } from 'vue';
@ -81,9 +80,9 @@ const formSchema = computed((): VbenFormSchema[] => {
]; ];
}); });
function handleSubmit(value: Recordable<any>) { function handleSubmit() {
// eslint-disable-next-line no-console loading.value = true;
console.log('register submit:', value); loading.value = false;
} }
</script> </script>