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 { verifyAccessToken } from '~/utils/jwt-utils';
import { unAuthorizedResponse } from '~/utils/response'; import { unAuthorizedResponse } from '~/utils/response';
export default eventHandler((event) => { export default eventHandler(async (event) => {
const userinfo = verifyAccessToken(event); const userinfo = verifyAccessToken(event);
if (!userinfo) { if (!userinfo) {
return unAuthorizedResponse(event); return unAuthorizedResponse(event);

View File

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

View File

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

View File

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

View File

@ -39,6 +39,11 @@
/* Used for success actions such as <message> */ /* 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: 144 57% 58%;
--success-foreground: 0 0% 98%; --success-foreground: 0 0% 98%;

View File

@ -38,6 +38,11 @@
/* Used for success actions such as <message> */ /* 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: 144 57% 58%;
--success-foreground: 0 0% 98%; --success-foreground: 0 0% 98%;

View File

@ -216,7 +216,7 @@ export function useElementPlusDesignTokens() {
: getCssVariableValue('--destructive-50'), : getCssVariableValue('--destructive-50'),
'--el-color-info-light-8': border, '--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': getCssVariableValue('--primary-500'),
'--el-color-primary-dark-2': getCssVariableValue('--primary'), '--el-color-primary-dark-2': getCssVariableValue('--primary'),
@ -258,6 +258,12 @@ export function useElementPlusDesignTokens() {
'--el-fill-color-blank': background, '--el-fill-color-blank': background,
'--el-fill-color-light': getCssVariableValue('--accent'), '--el-fill-color-light': getCssVariableValue('--accent'),
'--el-fill-color-lighter': getCssVariableValue('--accent-lighter'), '--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-primary': getCssVariableValue('--foreground'),
'--el-text-color-regular': getCssVariableValue('--foreground'), '--el-text-color-regular': getCssVariableValue('--foreground'),

View File

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

View File

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

View File

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

View File

@ -209,7 +209,7 @@ export const useTabbarStore = defineStore('core-tabbar', {
(item) => getTabPath(item) === getTabPath(tab), (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 rightTabs = this.tabs.slice(index + 1);
const paths: string[] = []; const paths: string[] = [];

View File

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