This commit is contained in:
dap 2024-10-05 13:16:24 +08:00
commit 4ebd4821e2
14 changed files with 2524 additions and 378 deletions

View File

@ -1,7 +1,7 @@
import { verifyAccessToken } from '~/utils/jwt-utils';
import { unAuthorizedResponse } from '~/utils/response';
export default eventHandler((event) => {
export default eventHandler(async (event) => {
const userinfo = verifyAccessToken(event);
if (!userinfo) {
return unAuthorizedResponse(event);

View File

@ -6,6 +6,5 @@ export default eventHandler((event) => {
if (!userinfo) {
return unAuthorizedResponse(event);
}
return useResponseSuccess(userinfo);
});

View File

@ -26,6 +26,7 @@ export async function unicorn(): Promise<Linter.Config[]> {
'unicorn/prefer-at': 'off',
'unicorn/prefer-dom-node-text-content': 'off',
'unicorn/prefer-export-from': ['error', { ignoreUsedVariables: true }],
'unicorn/prefer-global-this': 'off',
'unicorn/prefer-top-level-await': 'off',
'unicorn/prevent-abbreviations': 'off',
},

View File

@ -107,10 +107,10 @@
}
},
"overrides": {
"@ctrl/tinycolor": "4.1.0",
"clsx": "2.1.1",
"pinia": "2.2.2",
"vue": "3.5.10"
"@ctrl/tinycolor": "catalog:",
"clsx": "catalog:",
"pinia": "catalog:",
"vue": "catalog:"
},
"neverBuiltDependencies": [
"canvas",

View File

@ -39,6 +39,11 @@
/* Used for success actions such as <message> */
--info: 180, 1.54%, 12.75%;
--info-foreground: 220, 4%, 58%;
/* Used for success actions such as <message> */
--success: 144 57% 58%;
--success-foreground: 0 0% 98%;

View File

@ -38,6 +38,11 @@
/* Used for success actions such as <message> */
--info: 240, 5%, 96%;
--info-foreground: 220, 4%, 58%;
/* Used for success actions such as <message> */
--success: 144 57% 58%;
--success-foreground: 0 0% 98%;

View File

@ -216,7 +216,7 @@ export function useElementPlusDesignTokens() {
: getCssVariableValue('--destructive-50'),
'--el-color-info-light-8': border,
'--el-color-info-light-9': background,
'--el-color-info-light-9': getCssVariableValue('--info'), // getCssVariableValue('--secondary'),
'--el-color-primary': getCssVariableValue('--primary-500'),
'--el-color-primary-dark-2': getCssVariableValue('--primary'),
@ -258,6 +258,12 @@ export function useElementPlusDesignTokens() {
'--el-fill-color-blank': background,
'--el-fill-color-light': getCssVariableValue('--accent'),
'--el-fill-color-lighter': getCssVariableValue('--accent-lighter'),
// 解决ElLoading背景色问题
'--el-mask-color': isDark.value
? 'rgba(0,0,0,.8)'
: 'rgba(255,255,255,.9)',
'--el-text-color-primary': getCssVariableValue('--foreground'),
'--el-text-color-regular': getCssVariableValue('--foreground'),

View File

@ -53,13 +53,20 @@ function transformComponent(
component: VNode,
route: RouteLocationNormalizedLoadedGeneric,
) {
//
if (!component) {
console.error(
'Component view not foundplease check the route configuration',
);
return undefined;
}
const routeName = route.name as string;
// name
if (!routeName) {
return component;
}
const componentName = (component.type as any).name;
const componentName = (component?.type as any)?.name;
// name
if (componentName) {

View File

@ -150,7 +150,7 @@ function removeItem(index: number) {
} else {
searchHistory.value.splice(index, 1);
}
activeIndex.value = activeIndex.value - 1 >= 0 ? activeIndex.value - 1 : 0;
activeIndex.value = Math.max(activeIndex.value - 1, 0);
scrollIntoView();
}

View File

@ -174,12 +174,15 @@ if (enableShortcutKey.value) {
/>
<div class="ml-2 w-full">
<div
v-if="tagText || text || $slots.tagText"
class="text-foreground mb-1 flex items-center text-sm font-medium"
>
{{ text }}
<Badge class="ml-2 text-green-400">
{{ tagText }}
</Badge>
<slot name="tagText">
<Badge v-if="tagText" class="ml-2 text-green-400">
{{ tagText }}
</Badge>
</slot>
</div>
<div class="text-muted-foreground text-xs font-normal">
{{ description }}
@ -208,7 +211,7 @@ if (enableShortcutKey.value) {
{{ altView }} L
</DropdownMenuShortcut>
</DropdownMenuItem>
<DropdownMenuSeparator />
<DropdownMenuSeparator v-if="preferences.widget.lockScreen" />
<DropdownMenuItem
class="mx-1 flex cursor-pointer items-center rounded-sm py-1 leading-8"
@click="handleLogout"

View File

@ -209,7 +209,7 @@ export const useTabbarStore = defineStore('core-tabbar', {
(item) => getTabPath(item) === getTabPath(tab),
);
if (index >= 0 && index < this.tabs.length - 1) {
if (index !== -1 && index < this.tabs.length - 1) {
const rightTabs = this.tabs.slice(index + 1);
const paths: string[] = [];

View File

@ -75,7 +75,7 @@ function changeLoading() {
</template>
<Grid>
<template #toolbar-actions>
<Button class="mr-2" type="primary">右按钮插槽</Button>
<Button class="mr-2" type="primary">插槽</Button>
</template>
<template #toolbar-tools>
<Button class="mr-2" type="primary" @click="changeBorder">

File diff suppressed because it is too large Load Diff

View File

@ -14,13 +14,13 @@ packages:
- playground
catalog:
'@changesets/changelog-github': ^0.5.0
'@changesets/cli': ^2.27.8
'@changesets/cli': ^2.27.9
'@changesets/git': ^3.0.1
'@clack/prompts': ^0.7.0
'@commitlint/cli': ^19.5.0
'@commitlint/config-conventional': ^19.5.0
'@ctrl/tinycolor': ^4.1.0
'@eslint/js': ^9.11.1
'@eslint/js': ^9.12.0
'@faker-js/faker': ^9.0.3
'@iconify/json': ^2.2.256
'@iconify/tailwind': ^1.1.3
@ -31,10 +31,10 @@ catalog:
'@manypkg/get-packages': ^2.2.2
'@nolebase/vitepress-plugin-git-changelog': ^2.5.0
'@playwright/test': ^1.47.2
'@stylistic/stylelint-plugin': ^3.1.0
'@stylistic/stylelint-plugin': ^3.1.1
'@tailwindcss/nesting': 0.0.0-insiders.565cd3e
'@tailwindcss/typography': ^0.5.15
'@tanstack/vue-query': ^5.59.0
'@tanstack/vue-query': ^5.59.1
'@tanstack/vue-store': ^0.5.5
'@types/archiver': ^6.0.2
'@types/chalk': ^2.2.0
@ -53,8 +53,8 @@ catalog:
'@vite-pwa/vitepress': ^0.5.3
'@vitejs/plugin-vue': ^5.1.4
'@vitejs/plugin-vue-jsx': ^4.0.1
'@vue/reactivity': ^3.5.10
'@vue/shared': ^3.5.10
'@vue/reactivity': ^3.5.11
'@vue/shared': ^3.5.11
'@vue/test-utils': ^2.4.6
'@vueuse/core': ^11.1.0
'@vueuse/integrations': ^11.1.0
@ -82,7 +82,7 @@ catalog:
dotenv: ^16.4.5
echarts: ^5.5.1
element-plus: ^2.8.4
eslint: ^9.11.1
eslint: ^9.12.0
eslint-config-turbo: ^2.1.3
eslint-plugin-command: ^0.2.6
eslint-plugin-eslint-comments: ^3.2.0
@ -94,7 +94,7 @@ catalog:
eslint-plugin-perfectionist: ^3.8.0
eslint-plugin-prettier: ^5.2.1
eslint-plugin-regexp: ^2.6.0
eslint-plugin-unicorn: ^55.0.0
eslint-plugin-unicorn: ^56.0.0
eslint-plugin-unused-imports: ^4.1.4
eslint-plugin-vitest: ^0.5.4
eslint-plugin-vue: ^9.28.0
@ -102,7 +102,7 @@ catalog:
find-up: ^7.0.0
get-port: ^7.1.0
globals: ^15.10.0
h3: ^1.12.0
h3: ^1.13.0
happy-dom: ^15.7.4
html-minifier-terser: ^7.2.0
husky: ^9.1.6
@ -119,14 +119,14 @@ catalog:
nprogress: ^0.2.0
ora: ^8.1.0
pinia: 2.2.2
pinia-plugin-persistedstate: ^4.0.2
pinia-plugin-persistedstate: ^4.1.1
pkg-types: ^1.2.0
playwright: ^1.47.2
postcss: ^8.4.47
postcss-antd-fixes: ^0.2.0
postcss-html: ^1.7.0
postcss-import: ^16.1.0
postcss-preset-env: ^10.0.5
postcss-preset-env: ^10.0.6
postcss-scss: ^4.0.9
prettier: ^3.3.3
prettier-plugin-tailwindcss: ^0.6.8
@ -148,7 +148,7 @@ catalog:
stylelint-order: ^6.0.4
stylelint-prettier: ^5.0.2
stylelint-scss: ^6.7.0
tailwind-merge: ^2.5.2
tailwind-merge: ^2.5.3
tailwindcss: ^3.4.13
tailwindcss-animate: ^1.0.7
theme-colors: ^0.1.0
@ -168,12 +168,12 @@ catalog:
vitepress: ^1.3.4
vitepress-plugin-group-icons: ^1.2.4
vitest: ^2.1.2
vue: ^3.5.10
vue: ^3.5.11
vue-eslint-parser: ^9.4.3
vue-i18n: ^10.0.3
vue-router: ^4.4.5
vue-tsc: ^2.1.6
vxe-pc-ui: ^4.2.9
vxe-pc-ui: ^4.2.13
vxe-table: ^4.7.84
watermark-js-plus: ^1.5.7
zod: ^3.23.8