This commit is contained in:
dap
2024-10-21 07:58:31 +08:00
77 changed files with 188 additions and 223 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "@vben/access",
"version": "5.4.1",
"version": "5.4.2",
"homepage": "https://github.com/vbenjs/vue-vben-admin",
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
"repository": {

View File

@@ -1,6 +1,6 @@
{
"name": "@vben/common-ui",
"version": "5.4.1",
"version": "5.4.2",
"homepage": "https://github.com/vbenjs/vue-vben-admin",
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
"repository": {

View File

@@ -44,7 +44,7 @@ declare global {
const renderLink = (href: string, text: string) =>
h(
'a',
{ href, target: '_blank', class: 'text-primary hover:text-primary-hover' },
{ href, target: '_blank', class: 'vben-link' },
{ default: () => text },
);
@@ -114,11 +114,7 @@ const devDependenciesItems = Object.keys(devDependencies).map((key) => ({
<Page :title="title">
<template #description>
<p class="text-foreground mt-3 text-sm leading-6">
<a
:href="VBEN_GITHUB_URL"
class="text-primary hover:text-primary-hover"
target="_blank"
>
<a :href="VBEN_GITHUB_URL" class="vben-link" target="_blank">
{{ name }}
</a>
{{ description }}

View File

@@ -1,8 +1,6 @@
<script setup lang="ts">
import type { VbenFormSchema } from '@vben-core/form-ui';
import type { LoginCodeEmits } from './types';
import { computed, reactive } from 'vue';
import { useRouter } from 'vue-router';
@@ -19,7 +17,7 @@ interface Props {
*/
loading?: boolean;
/**
* @zh_CN 登路径
* @zh_CN 登路径
*/
loginPath?: string;
/**
@@ -49,12 +47,12 @@ const props = withDefaults(defineProps<Props>(), {
});
const emit = defineEmits<{
submit: LoginCodeEmits['submit'];
submit: [{ code: string; phoneNumber: string; tenantId: string }];
}>();
const router = useRouter();
const [Form, { validate, setFieldValue }] = useVbenForm(
const [Form, { validate, setFieldValue, getValues }] = useVbenForm(
reactive({
commonConfig: {
hideLabel: true,
@@ -66,8 +64,8 @@ const [Form, { validate, setFieldValue }] = useVbenForm(
);
async function handleSubmit() {
const { valid, values } = await validate();
const { valid } = await validate();
const values = await getValues();
if (valid) {
emit('submit', {
tenantId: values?.tenantId,

View File

@@ -17,7 +17,7 @@ interface Props {
*/
loading?: boolean;
/**
* @zh_CN 登路径
* @zh_CN 登路径
*/
loginPath?: string;
/**
@@ -47,10 +47,10 @@ const props = withDefaults(defineProps<Props>(), {
});
const emit = defineEmits<{
submit: [string];
submit: [Record<string, any>];
}>();
const [Form, { validate }] = useVbenForm(
const [Form, { validate, getValues }] = useVbenForm(
reactive({
commonConfig: {
hideLabel: true,
@@ -64,10 +64,10 @@ const [Form, { validate }] = useVbenForm(
const router = useRouter();
async function handleSubmit() {
const { valid, values } = await validate();
const { valid } = await validate();
const values = await getValues();
if (valid) {
emit('submit', values?.email);
emit('submit', values);
}
}

View File

@@ -1,11 +1,7 @@
<script setup lang="ts">
import type { VbenFormSchema } from '@vben-core/form-ui';
import type {
AuthenticationProps,
LoginAndRegisterParams,
LoginEmits,
} from './types';
import type { AuthenticationProps, LoginAndRegisterParams } from './types';
import { computed, onMounted, reactive, ref } from 'vue';
import { useRouter } from 'vue-router';
@@ -13,6 +9,7 @@ import { useRouter } from 'vue-router';
import { $t } from '@vben/locales';
import { useVbenForm } from '@vben-core/form-ui';
import { VbenButton, VbenCheckbox } from '@vben-core/shadcn-ui';
import { cloneDeep } from '@vben-core/shared/utils';
import Title from './auth-title.vue';
import ThirdPartyLogin from './third-party-login.vue';
@@ -44,10 +41,10 @@ const props = withDefaults(defineProps<Props>(), {
});
const emit = defineEmits<{
submit: LoginEmits['submit'];
submit: [LoginAndRegisterParams];
}>();
const [Form, { setFieldValue, validate }] = useVbenForm(
const [Form, { setFieldValue, validate, getValues }] = useVbenForm(
reactive({
commonConfig: {
hideLabel: true,
@@ -66,7 +63,8 @@ const localUsername = localStorage.getItem(REMEMBER_ME_KEY) || '';
const rememberMe = ref(!!localUsername);
async function handleSubmit() {
const { valid, values } = await validate();
const { valid } = await validate();
const values = cloneDeep(await getValues());
if (valid) {
localStorage.setItem(
REMEMBER_ME_KEY,
@@ -126,7 +124,7 @@ defineExpose({ setFieldValue });
<span
v-if="showForgetPassword"
class="text-primary hover:text-primary-hover active:text-primary-active cursor-pointer text-sm font-normal"
class="vben-link text-sm font-normal"
@click="handleGo(forgetPasswordPath)"
>
{{ $t('authentication.forgetPassword') }}
@@ -175,7 +173,7 @@ defineExpose({ setFieldValue });
<div v-if="showRegister" class="mt-3 text-center text-sm">
{{ $t('authentication.accountTip') }}
<span
class="text-primary hover:text-primary-hover active:text-primary-active cursor-pointer text-sm font-normal"
class="vben-link text-sm font-normal"
@click="handleGo(registerPath)"
>
{{ $t('authentication.createAccount') }}

View File

@@ -15,7 +15,7 @@ interface Props {
*/
loading?: boolean;
/**
* @zh_CN 登路径
* @zh_CN 登路径
*/
loginPath?: string;
/**

View File

@@ -1,8 +1,7 @@
<script setup lang="ts">
import type { Recordable } from '@vben/types';
import type { VbenFormSchema } from '@vben-core/form-ui';
import type { RegisterEmits } from './types';
import { computed, reactive } from 'vue';
import { useRouter } from 'vue-router';
@@ -19,7 +18,7 @@ interface Props {
*/
loading?: boolean;
/**
* @zh_CN 登路径
* @zh_CN 登路径
*/
loginPath?: string;
/**
@@ -50,10 +49,10 @@ const props = withDefaults(defineProps<Props>(), {
});
const emit = defineEmits<{
submit: RegisterEmits['submit'];
submit: [Recordable<any>];
}>();
const [Form, { validate }] = useVbenForm(
const [Form, { validate, getValues }] = useVbenForm(
reactive({
commonConfig: {
hideLabel: true,
@@ -67,7 +66,8 @@ const [Form, { validate }] = useVbenForm(
const router = useRouter();
async function handleSubmit() {
const { valid, values } = await validate();
const { valid } = await validate();
const values = await getValues();
if (valid) {
emit('submit', values as { password: string; username: string });
}
@@ -107,10 +107,7 @@ function goToLogin() {
</VbenButton>
<div class="mt-4 text-center text-sm">
{{ $t('authentication.alreadyHaveAccount') }}
<span
class="text-primary hover:text-primary-hover cursor-pointer text-sm font-normal"
@click="goToLogin()"
>
<span class="vben-link text-sm font-normal" @click="goToLogin()">
{{ $t('authentication.goToLogin') }}
</span>
</div>

View File

@@ -1,6 +1,6 @@
{
"name": "@vben/hooks",
"version": "5.4.1",
"version": "5.4.2",
"homepage": "https://github.com/vbenjs/vue-vben-admin",
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
"repository": {

View File

@@ -1,6 +1,6 @@
{
"name": "@vben/layouts",
"version": "5.4.1",
"version": "5.4.2",
"homepage": "https://github.com/vbenjs/vue-vben-admin",
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
"repository": {

View File

@@ -1,4 +1,6 @@
<script setup lang="ts">
import type { Recordable } from '@vben/types';
import { computed, reactive } from 'vue';
import { $t } from '@vben/locales';
@@ -11,14 +13,6 @@ interface Props {
text?: string;
}
interface LockAndRegisterParams {
lockScreenPassword: string;
}
interface RegisterEmits {
submit: [LockAndRegisterParams];
}
defineOptions({
name: 'LockScreenModal',
});
@@ -29,10 +23,10 @@ withDefaults(defineProps<Props>(), {
});
const emit = defineEmits<{
submit: RegisterEmits['submit'];
submit: [Recordable<any>];
}>();
const [Form, { resetForm, validate }] = useVbenForm(
const [Form, { resetForm, validate, getValues }] = useVbenForm(
reactive({
commonConfig: {
hideLabel: true,
@@ -68,7 +62,8 @@ const [Modal] = useVbenModal({
});
async function handleSubmit() {
const { valid, values } = await validate();
const { valid } = await validate();
const values = await getValues();
if (valid) {
emit('submit', values?.lockScreenPassword);
}

View File

@@ -1,6 +1,6 @@
{
"name": "@vben/plugins",
"version": "5.4.1",
"version": "5.4.2",
"homepage": "https://github.com/vbenjs/vue-vben-admin",
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
"repository": {

View File

@@ -1,6 +1,6 @@
{
"name": "@vben/request",
"version": "5.4.1",
"version": "5.4.2",
"homepage": "https://github.com/vbenjs/vue-vben-admin",
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
"repository": {