refactor(project): re-adjust the overall folder
This commit is contained in:
@@ -4,6 +4,7 @@ import type { LoginCodeParams } from '@vben/common-ui';
|
||||
import { ref } from 'vue';
|
||||
|
||||
import { AuthenticationCodeLogin } from '@vben/common-ui';
|
||||
import { LOGIN_PATH } from '@vben/constants';
|
||||
|
||||
defineOptions({ name: 'CodeLogin' });
|
||||
|
||||
@@ -21,5 +22,9 @@ async function handleLogin(values: LoginCodeParams) {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<AuthenticationCodeLogin :loading="loading" @submit="handleLogin" />
|
||||
<AuthenticationCodeLogin
|
||||
:loading="loading"
|
||||
:login-path="LOGIN_PATH"
|
||||
@submit="handleLogin"
|
||||
/>
|
||||
</template>
|
||||
|
@@ -2,6 +2,7 @@
|
||||
import { ref } from 'vue';
|
||||
|
||||
import { AuthenticationForgetPassword } from '@vben/common-ui';
|
||||
import { LOGIN_PATH } from '@vben/constants';
|
||||
|
||||
defineOptions({ name: 'ForgetPassword' });
|
||||
|
||||
@@ -14,5 +15,9 @@ function handleSubmit(value: string) {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<AuthenticationForgetPassword :loading="loading" @submit="handleSubmit" />
|
||||
<AuthenticationForgetPassword
|
||||
:loading="loading"
|
||||
:login-path="LOGIN_PATH"
|
||||
@submit="handleSubmit"
|
||||
/>
|
||||
</template>
|
||||
|
@@ -1,9 +1,10 @@
|
||||
<script lang="ts" setup>
|
||||
import { AuthenticationQrCodeLogin } from '@vben/common-ui';
|
||||
import { LOGIN_PATH } from '@vben/constants';
|
||||
|
||||
defineOptions({ name: 'QrCodeLogin' });
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<AuthenticationQrCodeLogin />
|
||||
<AuthenticationQrCodeLogin :login-path="LOGIN_PATH" />
|
||||
</template>
|
||||
|
@@ -4,6 +4,7 @@ import type { LoginAndRegisterParams } from '@vben/common-ui';
|
||||
import { ref } from 'vue';
|
||||
|
||||
import { AuthenticationRegister } from '@vben/common-ui';
|
||||
import { LOGIN_PATH } from '@vben/constants';
|
||||
|
||||
defineOptions({ name: 'Register' });
|
||||
|
||||
@@ -16,5 +17,9 @@ function handleSubmit(value: LoginAndRegisterParams) {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<AuthenticationRegister :loading="loading" @submit="handleSubmit" />
|
||||
<AuthenticationRegister
|
||||
:loading="loading"
|
||||
:login-path="LOGIN_PATH"
|
||||
@submit="handleSubmit"
|
||||
/>
|
||||
</template>
|
||||
|
@@ -16,7 +16,7 @@ import {
|
||||
WorkbenchTodo,
|
||||
WorkbenchTrends,
|
||||
} from '@vben/common-ui';
|
||||
import { preferences } from '@vben-core/preferences';
|
||||
import { preferences } from '@vben/preferences';
|
||||
|
||||
import { useAccessStore } from '#/store';
|
||||
|
||||
|
@@ -7,7 +7,7 @@ import { AccessControl, useAccess } from '@vben/access';
|
||||
|
||||
import { Button } from 'ant-design-vue';
|
||||
|
||||
import { useAccessStore, useAppStore } from '#/store';
|
||||
import { resetAllStores, useAccessStore } from '#/store';
|
||||
|
||||
defineOptions({ name: 'AccessButtonControl' });
|
||||
|
||||
@@ -28,7 +28,6 @@ const accounts: Record<string, LoginAndRegisterParams> = {
|
||||
|
||||
const { accessMode, hasAccessByCodes } = useAccess();
|
||||
const accessStore = useAccessStore();
|
||||
const appStore = useAppStore();
|
||||
const router = useRouter();
|
||||
|
||||
function roleButtonType(role: string) {
|
||||
@@ -41,7 +40,7 @@ async function changeAccount(role: string) {
|
||||
}
|
||||
|
||||
const account = accounts[role];
|
||||
appStore.resetAppState();
|
||||
resetAllStores();
|
||||
await accessStore.authLogin(account, async () => {
|
||||
router.go(0);
|
||||
});
|
||||
|
@@ -7,7 +7,7 @@ import { useAccess } from '@vben/access';
|
||||
|
||||
import { Button } from 'ant-design-vue';
|
||||
|
||||
import { useAccessStore, useAppStore } from '#/store';
|
||||
import { resetAllStores, useAccessStore } from '#/store';
|
||||
|
||||
defineOptions({ name: 'Access' });
|
||||
|
||||
@@ -28,7 +28,6 @@ const accounts: Record<string, LoginAndRegisterParams> = {
|
||||
|
||||
const { accessMode, toggleAccessMode } = useAccess();
|
||||
const accessStore = useAccessStore();
|
||||
const appStore = useAppStore();
|
||||
const router = useRouter();
|
||||
|
||||
function roleButtonType(role: string) {
|
||||
@@ -41,7 +40,7 @@ async function changeAccount(role: string) {
|
||||
}
|
||||
|
||||
const account = accounts[role];
|
||||
appStore.resetAppState();
|
||||
resetAllStores();
|
||||
await accessStore.authLogin(account, async () => {
|
||||
router.go(0);
|
||||
});
|
||||
@@ -49,7 +48,8 @@ async function changeAccount(role: string) {
|
||||
|
||||
async function handleToggleAccessMode() {
|
||||
await toggleAccessMode();
|
||||
appStore.resetAppState();
|
||||
resetAllStores();
|
||||
|
||||
await accessStore.authLogin(accounts.super, async () => {
|
||||
router.go(0);
|
||||
});
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<script lang="ts" setup>
|
||||
import type { LoginExpiredModeType } from '@vben/types';
|
||||
|
||||
import { preferences, updatePreferences } from '@vben-core/preferences';
|
||||
import { preferences, updatePreferences } from '@vben/preferences';
|
||||
|
||||
import { Button } from 'ant-design-vue';
|
||||
|
||||
|
Reference in New Issue
Block a user