Compare commits

..

1 Commits

Author SHA1 Message Date
soybeanfe
8b2db609a9 style(projects): fix lint code and format code 2026-03-09 12:19:23 +08:00
29 changed files with 96 additions and 518 deletions

View File

@@ -1,61 +1,5 @@
# Changelog
## [v2.1.0](https://github.com/soybeanjs/soybean-admin/compare/v2.0.2...v2.1.0) (2026-03-09)
###    🚨 Breaking Changes
- **projects**: integrate oxlint and oxfmt &nbsp;-&nbsp; by **soybeanfe** [<samp>(6ff74)</samp>](https://github.com/soybeanjs/soybean-admin/commit/6ff74c0c)
### &nbsp;&nbsp;&nbsp;🚀 Features
- **components**:
- Column settings support fixed columns. &nbsp;-&nbsp; by @m-xlsea [<samp>(70658)</samp>](https://github.com/soybeanjs/soybean-admin/commit/70658643)
- Add “Select All” to TableColumnSetting &nbsp;-&nbsp; by @wenyuanw [<samp>(0081b)</samp>](https://github.com/soybeanjs/soybean-admin/commit/0081b9c0)
- **logo**:
- use new logo &nbsp;-&nbsp; by @soybeanjs [<samp>(5aac5)</samp>](https://github.com/soybeanjs/soybean-admin/commit/5aac540a)
- **projects**:
- add the plugin: vite-plugin-vue-transition-root-validator, to optimize the development experience. &nbsp;-&nbsp; by **Azir-11** [<samp>(30e3c)</samp>](https://github.com/soybeanjs/soybean-admin/commit/30e3cdc7)
- **types**:
- Added type definition `force` to router push options. &nbsp;-&nbsp; by @m-xlsea [<samp>(a3794)</samp>](https://github.com/soybeanjs/soybean-admin/commit/a37949f2)
- **workflows**:
- add opencode workflow for issue and PR comment triggers &nbsp;-&nbsp; by @soybeanjs [<samp>(dacee)</samp>](https://github.com/soybeanjs/soybean-admin/commit/dacee143)
### &nbsp;&nbsp;&nbsp;🐞 Bug Fixes
- **projects**:
- fix the long list TableColumnSetting component exceeds the viewport. &nbsp;-&nbsp; by **skyfeiz** [<samp>(cbfb9)</samp>](https://github.com/soybeanjs/soybean-admin/commit/cbfb932f)
- fix NButton props conflicts. &nbsp;-&nbsp; by **skyfeiz** [<samp>(54107)</samp>](https://github.com/soybeanjs/soybean-admin/commit/54107aca)
- ensure HTML lang attribute is updated when setting locale &nbsp;-&nbsp; by @pan0xc [<samp>(f96c3)</samp>](https://github.com/soybeanjs/soybean-admin/commit/f96c3c9e)
- correct HTML lang attribute to standard format &nbsp;-&nbsp; by @pan0xc [<samp>(b520d)</samp>](https://github.com/soybeanjs/soybean-admin/commit/b520db3e)
- **router**:
- simplify route guard logic and remove unnecessary next calls &nbsp;-&nbsp; by **soybeanfe** [<samp>(3c2cb)</samp>](https://github.com/soybeanjs/soybean-admin/commit/3c2cbb74)
### &nbsp;&nbsp;&nbsp;🛠 Optimizations
- **projects**:
- modify the injection location of the token. &nbsp;-&nbsp; by **Azir-11** [<samp>(9d48c)</samp>](https://github.com/soybeanjs/soybean-admin/commit/9d48ca5f)
- optimize unocss config &nbsp;-&nbsp; by **soybeanfe** [<samp>(6fc6f)</samp>](https://github.com/soybeanjs/soybean-admin/commit/6fc6f1c9)
### &nbsp;&nbsp;&nbsp;📖 Documentation
- **projects**: V2 has been released. &nbsp;-&nbsp; by **skyfeiz** [<samp>(d7394)</samp>](https://github.com/soybeanjs/soybean-admin/commit/d73947a5)
### &nbsp;&nbsp;&nbsp;🏡 Chore
- **deps**:
- update deps &nbsp;-&nbsp; by @soybeanjs [<samp>(232e1)</samp>](https://github.com/soybeanjs/soybean-admin/commit/232e1ac4)
- update deps &nbsp;-&nbsp; by @soybeanjs [<samp>(2a023)</samp>](https://github.com/soybeanjs/soybean-admin/commit/2a0231da)
- update deps &nbsp;-&nbsp; by **soybeanfe** [<samp>(b867c)</samp>](https://github.com/soybeanjs/soybean-admin/commit/b867c290)
### &nbsp;&nbsp;&nbsp;🎨 Styles
- **projects**: fix lint code and format code &nbsp;-&nbsp; by **soybeanfe** [<samp>(781a1)</samp>](https://github.com/soybeanjs/soybean-admin/commit/781a18f4)
### &nbsp;&nbsp;&nbsp;❤️ Contributors
[![pan0xc](https://github.com/pan0xc.png?size=48)](https://github.com/pan0xc)&nbsp;&nbsp;[![m-xlsea](https://github.com/m-xlsea.png?size=48)](https://github.com/m-xlsea)&nbsp;&nbsp;[![soybeanjs](https://github.com/soybeanjs.png?size=48)](https://github.com/soybeanjs)&nbsp;&nbsp;[![wenyuanw](https://github.com/wenyuanw.png?size=48)](https://github.com/wenyuanw)&nbsp;&nbsp;
[soybeanfe](mailto:honghuangdc@gmail.com),&nbsp;[Azir-11](mailto:2075125282@qq.com),&nbsp;[skyfeiz](mailto:webzhangfei@163.com),&nbsp;
## [v2.0.2](https://github.com/soybeanjs/soybean-admin/compare/v2.0.1...v2.0.2) (2025-12-23)
### &nbsp;&nbsp;&nbsp;🐞 Bug Fixes

View File

@@ -1,7 +1,7 @@
import process from 'node:process';
import path from 'node:path';
import { presetIcons } from 'unocss';
import unocss from 'unocss/vite';
import unocss from '@unocss/vite';
import { presetIcons } from '@unocss/preset-icons';
import { FileSystemIconLoader } from '@iconify/utils/lib/loader/node-loaders';
export function setupUnocss(viteEnv: Env.ImportMeta) {

View File

@@ -1,12 +1,3 @@
import { defineConfig } from '@soybeanjs/eslint-config-vue';
export default defineConfig({
'vue/component-name-in-template-casing': [
'warn',
'PascalCase',
{
registeredComponentsOnly: false,
ignores: ['/^icon-/']
}
]
});
export default defineConfig();

View File

@@ -1,6 +1,6 @@
{
"name": "soybean-admin",
"version": "2.1.0",
"version": "2.0.2",
"description": "A fresh and elegant admin template, based on Vue3、Vite7、TypeScript、NaiveUI and UnoCSS. 一个基于Vue3、Vite7、TypeScript、NaiveUI and UnoCSS的清新优雅的中后台模版。",
"keywords": [
"TypeScript",
@@ -74,6 +74,11 @@
"@soybeanjs/eslint-config-vue": "^0.0.2",
"@types/node": "25.3.5",
"@types/nprogress": "0.2.3",
"@unocss/preset-icons": "66.6.6",
"@unocss/preset-uno": "66.6.6",
"@unocss/transformer-directives": "66.6.6",
"@unocss/transformer-variant-group": "66.6.6",
"@unocss/vite": "66.6.6",
"@vitejs/plugin-vue": "6.0.4",
"@vitejs/plugin-vue-jsx": "5.1.4",
"consola": "3.4.2",
@@ -85,7 +90,6 @@
"simple-git-hooks": "2.13.1",
"tsx": "4.21.0",
"typescript": "5.9.3",
"unocss": "^66.6.6",
"unplugin-icons": "23.0.1",
"unplugin-vue-components": "31.0.0",
"vite": "7.3.1",

View File

@@ -1,6 +1,6 @@
{
"name": "@sa/alova",
"version": "2.1.0",
"version": "2.0.2",
"typesVersions": {
"*": {
"*": [

View File

@@ -1,6 +1,6 @@
{
"name": "@sa/axios",
"version": "2.1.0",
"version": "2.0.2",
"typesVersions": {
"*": {
"*": [

View File

@@ -1,6 +1,6 @@
{
"name": "@sa/color",
"version": "2.1.0",
"version": "2.0.2",
"typesVersions": {
"*": {
"*": [

View File

@@ -1,6 +1,6 @@
{
"name": "@sa/hooks",
"version": "2.1.0",
"version": "2.0.2",
"typesVersions": {
"*": {
"*": [

View File

@@ -1,6 +1,6 @@
{
"name": "@sa/materials",
"version": "2.1.0",
"version": "2.0.2",
"typesVersions": {
"*": {
"*": [

View File

@@ -1,6 +1,6 @@
{
"name": "@sa/scripts",
"version": "2.1.0",
"version": "2.0.2",
"bin": {
"sa": "./bin.ts"
},

View File

@@ -1,6 +1,6 @@
{
"name": "@sa/uno-preset",
"version": "2.1.0",
"version": "2.0.2",
"typesVersions": {
"*": {
"*": [

View File

@@ -1,7 +1,7 @@
// @unocss-include
import type { Preset } from '@unocss/core';
import type { Theme } from '@unocss/preset-mini';
import type { Theme } from '@unocss/preset-uno';
export function presetSoybeanAdmin(): Preset<Theme> {
const preset: Preset<Theme> = {

View File

@@ -1,6 +1,6 @@
{
"name": "@sa/utils",
"version": "2.1.0",
"version": "2.0.2",
"typesVersions": {
"*": {
"*": [

409
pnpm-lock.yaml generated
View File

@@ -93,6 +93,21 @@ importers:
'@types/nprogress':
specifier: 0.2.3
version: 0.2.3
'@unocss/preset-icons':
specifier: 66.6.6
version: 66.6.6
'@unocss/preset-uno':
specifier: 66.6.6
version: 66.6.6
'@unocss/transformer-directives':
specifier: 66.6.6
version: 66.6.6
'@unocss/transformer-variant-group':
specifier: 66.6.6
version: 66.6.6
'@unocss/vite':
specifier: 66.6.6
version: 66.6.6(vite@7.3.1(@types/node@25.3.5)(jiti@2.6.1)(sass@1.97.3)(tsx@4.21.0)(yaml@2.8.2))
'@vitejs/plugin-vue':
specifier: 6.0.4
version: 6.0.4(vite@7.3.1(@types/node@25.3.5)(jiti@2.6.1)(sass@1.97.3)(tsx@4.21.0)(yaml@2.8.2))(vue@3.5.29(typescript@5.9.3))
@@ -126,9 +141,6 @@ importers:
typescript:
specifier: 5.9.3
version: 5.9.3
unocss:
specifier: ^66.6.6
version: 66.6.6(vite@7.3.1(@types/node@25.3.5)(jiti@2.6.1)(sass@1.97.3)(tsx@4.21.0)(yaml@2.8.2))
unplugin-icons:
specifier: 23.0.1
version: 23.0.1(@vue/compiler-sfc@3.5.29)
@@ -750,9 +762,6 @@ packages:
'@napi-rs/wasm-runtime@0.2.12':
resolution: {integrity: sha512-ZVWUcfwY4E/yPitQJl481FjFo3K22D6qF0DuFH6Y/nbnE11GY5uguDxZMGXPQ8WQ0128MXQD7TnfHyK4oWoIJQ==}
'@napi-rs/wasm-runtime@1.1.1':
resolution: {integrity: sha512-p64ah1M1ld8xjWv3qbvFwHiFVWrq1yFvV4f7w+mzaqiR4IlSgkqhcRdHwsGgomwzBH51sRY4NEowLxnaBjcW/A==}
'@nodelib/fs.scandir@2.1.5':
resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==}
engines: {node: '>= 8'}
@@ -765,136 +774,6 @@ packages:
resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==}
engines: {node: '>= 8'}
'@oxc-parser/binding-android-arm-eabi@0.115.0':
resolution: {integrity: sha512-VoB2rhgoqgYf64d6Qs5emONQW8ASiTc0xp+aUE4JUhxjX+0pE3gblTYDO0upcN5vt9UlBNmUhAwfSifkfre7nw==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [arm]
os: [android]
'@oxc-parser/binding-android-arm64@0.115.0':
resolution: {integrity: sha512-lWRX75u+gqfB4TF3pWCHuvhaeneAmRl2b2qNBcl4S6yJ0HtnT4VXOMEZrq747i4Zby1ZTxj6mtOe678Bg8gRLw==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [arm64]
os: [android]
'@oxc-parser/binding-darwin-arm64@0.115.0':
resolution: {integrity: sha512-ii/oOZjfGY1aszXTy29Z5DRyCEnBOrAXDVCvfdfXFQsOZlbbOa7NMHD7D+06YFe5qdxfmbWAYv4yn6QJi/0d2g==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [arm64]
os: [darwin]
'@oxc-parser/binding-darwin-x64@0.115.0':
resolution: {integrity: sha512-R/sW/p8l77wglbjpMcF+h/3rWbp9zk1mRP3U14mxTYIC2k3m+aLBpXXgk2zksqf9qKk5mcc4GIYsuCn9l8TgDg==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [x64]
os: [darwin]
'@oxc-parser/binding-freebsd-x64@0.115.0':
resolution: {integrity: sha512-CSJ5ldNm9wIGGkhaIJeGmxRMZbgxThRN+X1ufYQQUNi5jZDV/U3C2QDMywpP93fczNBj961hXtcUPO/oVGq4Pw==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [x64]
os: [freebsd]
'@oxc-parser/binding-linux-arm-gnueabihf@0.115.0':
resolution: {integrity: sha512-uWFwssE5dHfQ8lH+ktrsD9JA49+Qa0gtxZHUs62z1e91NgGz6O7jefHGI6aygNyKNS45pnnBSDSP/zV977MsOQ==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [arm]
os: [linux]
'@oxc-parser/binding-linux-arm-musleabihf@0.115.0':
resolution: {integrity: sha512-fZbqt8y/sKQ+v6bBCuv/mYYFoC0+fZI3mGDDEemmDOhT78+aUs2+4ZMdbd2btlXmnLaScl37r8IRbhnok5Ka9w==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [arm]
os: [linux]
'@oxc-parser/binding-linux-arm64-gnu@0.115.0':
resolution: {integrity: sha512-1ej/MjuTY9tJEunU/hUPIFmgH5PqgMQoRjNOvOkibtJ3Zqlw/+Lc+HGHDNET8sjbgIkWzdhX+p4J96A5CPdbag==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [arm64]
os: [linux]
libc: [glibc]
'@oxc-parser/binding-linux-arm64-musl@0.115.0':
resolution: {integrity: sha512-HjsZbJPH9mMd4swJRywVMsDZsJX0hyKb1iNHo5ijRl5yhtbO3lj7ImSrrL1oZ1VEg0te4iKmDGGz/6YPLd1G8w==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [arm64]
os: [linux]
libc: [musl]
'@oxc-parser/binding-linux-ppc64-gnu@0.115.0':
resolution: {integrity: sha512-zhhePoBrd7kQx3oClX/W6NldsuCbuMqaN9rRsY+6/WoorAb4j490PG/FjqgAXscWp2uSW2WV9L+ksn0wHrvsrg==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [ppc64]
os: [linux]
libc: [glibc]
'@oxc-parser/binding-linux-riscv64-gnu@0.115.0':
resolution: {integrity: sha512-t/IRojvUE9XrKu+/H1b8YINug+7Q6FLls5rsm2lxB5mnS8GN/eYAYrPgHkcg9/1SueRDSzGpDYu3lGWTObk1zw==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [riscv64]
os: [linux]
libc: [glibc]
'@oxc-parser/binding-linux-riscv64-musl@0.115.0':
resolution: {integrity: sha512-79jBHSSh/YpQRAmvYoaCfpyToRbJ/HBrdB7hxK2ku2JMehjopTVo+xMJss/RV7/ZYqeezgjvKDQzapJbgcjVZA==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [riscv64]
os: [linux]
libc: [musl]
'@oxc-parser/binding-linux-s390x-gnu@0.115.0':
resolution: {integrity: sha512-nA1TpxkhNTIOMMyiSSsa7XIVJVoOU/SsVrHIz3gHvWweB5PHCQfO7w+Lb2EP0lBWokv7HtA/KbF7aLDoXzmuMw==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [s390x]
os: [linux]
libc: [glibc]
'@oxc-parser/binding-linux-x64-gnu@0.115.0':
resolution: {integrity: sha512-9iVX789DoC3SaOOG+X6NcF/tVChgLp2vcHffzOC2/Z1JTPlz6bMG2ogvcW6/9s0BG2qvhNQImd+gbWYeQbOwVw==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [x64]
os: [linux]
libc: [glibc]
'@oxc-parser/binding-linux-x64-musl@0.115.0':
resolution: {integrity: sha512-RmQmk+mjCB0nMNfEYhaCxwofLo1Z95ebHw1AGvRiWGCd4zhCNOyskgCbMogIcQzSB3SuEKWgkssyaiQYVAA4hQ==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [x64]
os: [linux]
libc: [musl]
'@oxc-parser/binding-openharmony-arm64@0.115.0':
resolution: {integrity: sha512-viigraWWQhhDvX5aGq+wrQq58k00Xq3MHz/0R4AFMxGlZ8ogNonpEfNc73Q5Ly87Z6sU9BvxEdG0dnYTfVnmew==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [arm64]
os: [openharmony]
'@oxc-parser/binding-wasm32-wasi@0.115.0':
resolution: {integrity: sha512-IzGCrMwXhpb4kTXy/8lnqqqwjI7eOvy+r9AhVw+hsr8t1ecBBEHprcNy0aKatFHN6hsX7UMHHQmBAQjVvL/p1A==}
engines: {node: '>=14.0.0'}
cpu: [wasm32]
'@oxc-parser/binding-win32-arm64-msvc@0.115.0':
resolution: {integrity: sha512-/ym+Absk/TLFvbhh3se9XYuI1D7BrUVHw4RaG/2dmWKgBenrZHaJsgnRb7NJtaOyjEOLIPtULx1wDdVL0SX2eg==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [arm64]
os: [win32]
'@oxc-parser/binding-win32-ia32-msvc@0.115.0':
resolution: {integrity: sha512-AQSZjIR+b+Te7uaO/hGTMjT8/oxlYrvKrOTi4KTHF/O6osjHEatUQ3y6ZW2+8+lJxy20zIcGz6iQFmFq/qDKkg==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [ia32]
os: [win32]
'@oxc-parser/binding-win32-x64-msvc@0.115.0':
resolution: {integrity: sha512-oxUl82N+fIO9jIaXPph8SPPHQXrA08BHokBBJW8ct9F/x6o6bZE6eUAhUtWajbtvFhL8UYcCWRMba+kww6MBlA==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [x64]
os: [win32]
'@oxc-project/types@0.115.0':
resolution: {integrity: sha512-4n91DKnebUS4yjUHl2g3/b2T+IUdCfmoZGhmwsovZCDaJSs+QkVAM+0AqqTxHSsHfeiMuueT75cZaZcT/m0pSw==}
'@oxfmt/binding-android-arm-eabi@0.36.0':
resolution: {integrity: sha512-Z4yVHJWx/swHHjtr0dXrBZb6LxS+qNz1qdza222mWwPTUK4L790+5i3LTgjx3KYGBzcYpjaiZBw4vOx94dH7MQ==}
engines: {node: ^20.19.0 || >=22.12.0}
@@ -1550,11 +1429,6 @@ packages:
resolution: {integrity: sha512-KiROIzYdEV85YygXw6BI/Dx4fnBlFQu6Mq4QE4MOH9fFnhohw6wX/OAvDY2/C+ut0I3RSPKenvZJIVYqJNkhEw==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
'@unocss/cli@66.6.6':
resolution: {integrity: sha512-78SY8j4hAVelK+vP/adsDGaSjEITasYLFECJLHWxUJSzK+G9UIc5wtL/u4jA+zKvwVkHcDvbkcO5K6wwwpAixg==}
engines: {node: '>=14'}
hasBin: true
'@unocss/config@66.6.6':
resolution: {integrity: sha512-menlnkqAFX/4wR2aandY8hSqrt01JE+rOzvtQxWaBt8kf1du62b0sS72FE5Z40n6HlEsEbF91N9FCfhnzG6i6g==}
engines: {node: '>=14'}
@@ -1576,46 +1450,22 @@ packages:
'@unocss/inspector@66.6.6':
resolution: {integrity: sha512-CpXIsqHwxCXJtUjUz6S29diHCIA+EJ1u5WML/6m2YPI4ObgWAVKrExy09inSg2icS52lFkWWdWQSeqc9kl5W6Q==}
'@unocss/preset-attributify@66.6.6':
resolution: {integrity: sha512-3H12UI1rBt60PQy+S4IEeFYWu1/WQFuc2yhJ5mu/RCvX5/qwlIGanBpuh+xzTPXU1fWBlZN68yyO9uWOQgTqZQ==}
'@unocss/preset-icons@66.6.6':
resolution: {integrity: sha512-HfIEEqf3jyKexOB2Sux556n0NkPoUftb2H4+Cf7prJvKHopMkZ/OUkXjwvUlxt1e5UpAEaIa0A2Ir7+ApxXoGA==}
'@unocss/preset-mini@66.6.6':
resolution: {integrity: sha512-k+/95PKMPOK57cJcSmz34VkIFem8BlujRRx6/L0Yusw7vLJMh98k0rPhC5s+NomZ/d9ZPgbNylskLhItJlak3w==}
'@unocss/preset-tagify@66.6.6':
resolution: {integrity: sha512-KgBXYPYS0g4TVC3NLiIB78YIqUlvDLanz1EHIDo34rOTUfMgY8Uf5VuDJAzMu4Sc0LiwwBJbk6nIG9/Zm7ufWg==}
'@unocss/preset-typography@66.6.6':
resolution: {integrity: sha512-SM1km5nqt15z4sTabfOobSC633I5Ol5nnme6JFTra4wiyCUNs+Cg31nJ6jnopWDUT4SEAXqfUH7jKSSoCnI6ZA==}
'@unocss/preset-uno@66.6.6':
resolution: {integrity: sha512-40PcBDtlhW7QP7e/WOxC684IhN5T1dXvj1dgx9ZzK+8lEDGjcX7bN2noW4aSenzSrHymeSsMrL/0ltL4ED/5Zw==}
'@unocss/preset-web-fonts@66.6.6':
resolution: {integrity: sha512-5ikwgrJB8VPzKd0bqgGNgYUGix90KFnVtKJPjWTP5qsv3+ZtZnea1rRbAFl8i2t52hg35msNBsQo+40IC3xB6A==}
'@unocss/preset-wind3@66.6.6':
resolution: {integrity: sha512-rk6gPPIQ7z2DVucOqp7XZ4vGpKAuzBV1vtUDvDh5WscxzO/QlqaeTfTALk5YgGpmLaF4+ns6FrTgLjV+wHgHuQ==}
'@unocss/preset-wind4@66.6.6':
resolution: {integrity: sha512-caTDM9rZSlp4tyPWWAnwMvQr2PXq53LsEYwd3N8zj0ou2hcsqptJvF+mFvyhvGF66x26wWJr/FwuUEhh7qycaw==}
'@unocss/preset-wind@66.6.6':
resolution: {integrity: sha512-TMy3lZ35FP/4QqDHOLWZmV+RoOGWUDqnDEOTjOKI1CQARGta0ppUmq+IZMuI1ZJLuOa4OZ9V6SfnwMXwRLgXmw==}
'@unocss/rule-utils@66.6.6':
resolution: {integrity: sha512-krWtQKGshOaqQMuxeGq1NOA8NL35VdpYlmQEWOe39BY6TACT51bgQFu40MRfsAIMZZtoGS2YYTrnHojgR92omw==}
engines: {node: '>=14'}
'@unocss/transformer-attributify-jsx@66.6.6':
resolution: {integrity: sha512-NnDchmN2EeFLy4lfVqDgNe9j1+w2RLL2L9zKECXs5g6rDVfeeEK6FNgxSq3XnPcKltjNCy1pF4MaDOROG7r8yA==}
'@unocss/transformer-compile-class@66.6.6':
resolution: {integrity: sha512-KKssJxU8fZ9x84yznIirbtta2sB0LN/3lm0bp+Wl1298HITaNiVeG2n26iStQ3N7r240xRN2RarxncSVCMFwWw==}
'@unocss/transformer-directives@66.6.6':
resolution: {integrity: sha512-CReFTcBfMtKkRvzIqxL20VptWt5C1Om27dwoKzyVFBXv0jzViWysbu0y0AQg3bsgD4cFqndFyAGyeL84j0nbKg==}
@@ -2626,9 +2476,6 @@ packages:
estree-walker@2.0.2:
resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==}
estree-walker@3.0.3:
resolution: {integrity: sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==}
esutils@2.0.3:
resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==}
engines: {node: '>=0.10.0'}
@@ -3293,9 +3140,6 @@ packages:
lru-cache@5.1.1:
resolution: {integrity: sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==}
magic-regexp@0.10.0:
resolution: {integrity: sha512-Uly1Bu4lO1hwHUW0CQeSWuRtzCMNO00CmXtS8N6fyvB3B979GOEEeAkiTUDsmbYLAbvpUS/Kt5c4ibosAzVyVg==}
magic-string-ast@1.0.3:
resolution: {integrity: sha512-CvkkH1i81zl7mmb94DsRiFeG9V2fR2JeuK8yDgS8oiZSFa++wWLEgZ5ufEOyLHbvSbD1gTRKv9NdX69Rnvr9JA==}
engines: {node: '>=20.19.0'}
@@ -3507,15 +3351,6 @@ packages:
resolution: {integrity: sha512-qFOyK5PjiWZd+QQIh+1jhdb9LpxTF0qs7Pm8o5QHYZ0M3vKqSqzsZaEB6oWlxZ+q2sJBMI/Ktgd2N5ZwQoRHfg==}
engines: {node: '>= 0.4'}
oxc-parser@0.115.0:
resolution: {integrity: sha512-2w7Xn3CbS/zwzSY82S5WLemrRu3CT57uF7Lx8llrE/2bul6iMTcJE4Rbls7GDNbLn3ttATI68PfOz2Pt3KZ2cQ==}
engines: {node: ^20.19.0 || >=22.12.0}
oxc-walker@0.7.0:
resolution: {integrity: sha512-54B4KUhrzbzc4sKvKwVYm7E2PgeROpGba0/2nlNZMqfDyca+yOor5IMb4WLGBatGDT0nkzYdYuzylg7n3YfB7A==}
peerDependencies:
oxc-parser: '>=0.98.0'
oxfmt@0.36.0:
resolution: {integrity: sha512-/ejJ+KoSW6J9bcNT9a9UtJSJNWhJ3yOLSBLbkoFHJs/8CZjmaZVZAJe4YgO1KMJlKpNQasrn/G9JQUEZI3p0EQ==}
engines: {node: ^20.19.0 || >=22.12.0}
@@ -4191,9 +4026,6 @@ packages:
resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==}
engines: {node: '>= 0.8.0'}
type-level-regexp@0.1.17:
resolution: {integrity: sha512-wTk4DH3cxwk196uGLK/E9pE45aLfeKJacKmcEgEOA/q5dnPGNxXt0cfYdFxb57L+sEpf1oJH4Dnx/pnRcku9jg==}
typed-array-buffer@1.0.3:
resolution: {integrity: sha512-nAYYwfY3qnzX30IkA6AQZjVbtK6duGontcQm1WSG1MD94YLqK0515GNApXkoxKOWMusVssAHWLh9SeaoefYFGw==}
engines: {node: '>= 0.4'}
@@ -4252,21 +4084,6 @@ packages:
resolution: {integrity: sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==}
engines: {node: '>= 10.0.0'}
unocss@66.6.6:
resolution: {integrity: sha512-PRKK945e2oZKHV664MA5Z9CDHbvY/V79IvTOUWKZ514jpl3UsJU3sS+skgxmKJSmwrWvXE5OVcmPthJrD/7vxg==}
engines: {node: '>=14'}
peerDependencies:
'@unocss/astro': 66.6.6
'@unocss/postcss': 66.6.6
'@unocss/webpack': 66.6.6
peerDependenciesMeta:
'@unocss/astro':
optional: true
'@unocss/postcss':
optional: true
'@unocss/webpack':
optional: true
unplugin-icons@23.0.1:
resolution: {integrity: sha512-rv0XEJepajKzDLvRUWASM8K+8+/CCfZn2jtogXqg6RIp7kpatRc/aFrVJn8ANQA09e++lPEEv9yX8cC9enc+QQ==}
peerDependencies:
@@ -5068,13 +4885,6 @@ snapshots:
'@tybys/wasm-util': 0.10.1
optional: true
'@napi-rs/wasm-runtime@1.1.1':
dependencies:
'@emnapi/core': 1.8.1
'@emnapi/runtime': 1.8.1
'@tybys/wasm-util': 0.10.1
optional: true
'@nodelib/fs.scandir@2.1.5':
dependencies:
'@nodelib/fs.stat': 2.0.5
@@ -5087,70 +4897,6 @@ snapshots:
'@nodelib/fs.scandir': 2.1.5
fastq: 1.20.1
'@oxc-parser/binding-android-arm-eabi@0.115.0':
optional: true
'@oxc-parser/binding-android-arm64@0.115.0':
optional: true
'@oxc-parser/binding-darwin-arm64@0.115.0':
optional: true
'@oxc-parser/binding-darwin-x64@0.115.0':
optional: true
'@oxc-parser/binding-freebsd-x64@0.115.0':
optional: true
'@oxc-parser/binding-linux-arm-gnueabihf@0.115.0':
optional: true
'@oxc-parser/binding-linux-arm-musleabihf@0.115.0':
optional: true
'@oxc-parser/binding-linux-arm64-gnu@0.115.0':
optional: true
'@oxc-parser/binding-linux-arm64-musl@0.115.0':
optional: true
'@oxc-parser/binding-linux-ppc64-gnu@0.115.0':
optional: true
'@oxc-parser/binding-linux-riscv64-gnu@0.115.0':
optional: true
'@oxc-parser/binding-linux-riscv64-musl@0.115.0':
optional: true
'@oxc-parser/binding-linux-s390x-gnu@0.115.0':
optional: true
'@oxc-parser/binding-linux-x64-gnu@0.115.0':
optional: true
'@oxc-parser/binding-linux-x64-musl@0.115.0':
optional: true
'@oxc-parser/binding-openharmony-arm64@0.115.0':
optional: true
'@oxc-parser/binding-wasm32-wasi@0.115.0':
dependencies:
'@napi-rs/wasm-runtime': 1.1.1
optional: true
'@oxc-parser/binding-win32-arm64-msvc@0.115.0':
optional: true
'@oxc-parser/binding-win32-ia32-msvc@0.115.0':
optional: true
'@oxc-parser/binding-win32-x64-msvc@0.115.0':
optional: true
'@oxc-project/types@0.115.0': {}
'@oxfmt/binding-android-arm-eabi@0.36.0':
optional: true
@@ -5625,24 +5371,6 @@ snapshots:
'@typescript-eslint/types': 8.56.1
eslint-visitor-keys: 5.0.1
'@unocss/cli@66.6.6':
dependencies:
'@jridgewell/remapping': 2.3.5
'@unocss/config': 66.6.6
'@unocss/core': 66.6.6
'@unocss/preset-wind3': 66.6.6
'@unocss/preset-wind4': 66.6.6
'@unocss/transformer-directives': 66.6.6
cac: 6.7.14
chokidar: 5.0.0
colorette: 2.0.20
consola: 3.4.2
magic-string: 0.30.21
pathe: 2.0.3
perfect-debounce: 2.1.0
tinyglobby: 0.2.15
unplugin-utils: 0.3.1
'@unocss/config@66.6.6':
dependencies:
'@unocss/core': 66.6.6
@@ -5687,10 +5415,6 @@ snapshots:
gzip-size: 6.0.0
sirv: 3.0.2
'@unocss/preset-attributify@66.6.6':
dependencies:
'@unocss/core': 66.6.6
'@unocss/preset-icons@66.6.6':
dependencies:
'@iconify/utils': 3.1.0
@@ -5703,57 +5427,22 @@ snapshots:
'@unocss/extractor-arbitrary-variants': 66.6.6
'@unocss/rule-utils': 66.6.6
'@unocss/preset-tagify@66.6.6':
dependencies:
'@unocss/core': 66.6.6
'@unocss/preset-typography@66.6.6':
dependencies:
'@unocss/core': 66.6.6
'@unocss/rule-utils': 66.6.6
'@unocss/preset-uno@66.6.6':
dependencies:
'@unocss/core': 66.6.6
'@unocss/preset-wind3': 66.6.6
'@unocss/preset-web-fonts@66.6.6':
dependencies:
'@unocss/core': 66.6.6
ofetch: 1.5.1
'@unocss/preset-wind3@66.6.6':
dependencies:
'@unocss/core': 66.6.6
'@unocss/preset-mini': 66.6.6
'@unocss/rule-utils': 66.6.6
'@unocss/preset-wind4@66.6.6':
dependencies:
'@unocss/core': 66.6.6
'@unocss/extractor-arbitrary-variants': 66.6.6
'@unocss/rule-utils': 66.6.6
'@unocss/preset-wind@66.6.6':
dependencies:
'@unocss/core': 66.6.6
'@unocss/preset-wind3': 66.6.6
'@unocss/rule-utils@66.6.6':
dependencies:
'@unocss/core': 66.6.6
magic-string: 0.30.21
'@unocss/transformer-attributify-jsx@66.6.6':
dependencies:
'@unocss/core': 66.6.6
oxc-parser: 0.115.0
oxc-walker: 0.7.0(oxc-parser@0.115.0)
'@unocss/transformer-compile-class@66.6.6':
dependencies:
'@unocss/core': 66.6.6
'@unocss/transformer-directives@66.6.6':
dependencies:
'@unocss/core': 66.6.6
@@ -6932,10 +6621,6 @@ snapshots:
estree-walker@2.0.2: {}
estree-walker@3.0.3:
dependencies:
'@types/estree': 1.0.8
esutils@2.0.3: {}
etag@1.8.1: {}
@@ -7579,16 +7264,6 @@ snapshots:
dependencies:
yallist: 3.1.1
magic-regexp@0.10.0:
dependencies:
estree-walker: 3.0.3
magic-string: 0.30.21
mlly: 1.8.1
regexp-tree: 0.1.27
type-level-regexp: 0.1.17
ufo: 1.6.3
unplugin: 2.3.11
magic-string-ast@1.0.3:
dependencies:
magic-string: 0.30.21
@@ -7829,36 +7504,6 @@ snapshots:
object-keys: 1.1.1
safe-push-apply: 1.0.0
oxc-parser@0.115.0:
dependencies:
'@oxc-project/types': 0.115.0
optionalDependencies:
'@oxc-parser/binding-android-arm-eabi': 0.115.0
'@oxc-parser/binding-android-arm64': 0.115.0
'@oxc-parser/binding-darwin-arm64': 0.115.0
'@oxc-parser/binding-darwin-x64': 0.115.0
'@oxc-parser/binding-freebsd-x64': 0.115.0
'@oxc-parser/binding-linux-arm-gnueabihf': 0.115.0
'@oxc-parser/binding-linux-arm-musleabihf': 0.115.0
'@oxc-parser/binding-linux-arm64-gnu': 0.115.0
'@oxc-parser/binding-linux-arm64-musl': 0.115.0
'@oxc-parser/binding-linux-ppc64-gnu': 0.115.0
'@oxc-parser/binding-linux-riscv64-gnu': 0.115.0
'@oxc-parser/binding-linux-riscv64-musl': 0.115.0
'@oxc-parser/binding-linux-s390x-gnu': 0.115.0
'@oxc-parser/binding-linux-x64-gnu': 0.115.0
'@oxc-parser/binding-linux-x64-musl': 0.115.0
'@oxc-parser/binding-openharmony-arm64': 0.115.0
'@oxc-parser/binding-wasm32-wasi': 0.115.0
'@oxc-parser/binding-win32-arm64-msvc': 0.115.0
'@oxc-parser/binding-win32-ia32-msvc': 0.115.0
'@oxc-parser/binding-win32-x64-msvc': 0.115.0
oxc-walker@0.7.0(oxc-parser@0.115.0):
dependencies:
magic-regexp: 0.10.0
oxc-parser: 0.115.0
oxfmt@0.36.0:
dependencies:
tinypool: 2.1.0
@@ -8602,8 +8247,6 @@ snapshots:
dependencies:
prelude-ls: 1.2.1
type-level-regexp@0.1.17: {}
typed-array-buffer@1.0.3:
dependencies:
call-bound: 1.0.4
@@ -8701,28 +8344,6 @@ snapshots:
universalify@2.0.1: {}
unocss@66.6.6(vite@7.3.1(@types/node@25.3.5)(jiti@2.6.1)(sass@1.97.3)(tsx@4.21.0)(yaml@2.8.2)):
dependencies:
'@unocss/cli': 66.6.6
'@unocss/core': 66.6.6
'@unocss/preset-attributify': 66.6.6
'@unocss/preset-icons': 66.6.6
'@unocss/preset-mini': 66.6.6
'@unocss/preset-tagify': 66.6.6
'@unocss/preset-typography': 66.6.6
'@unocss/preset-uno': 66.6.6
'@unocss/preset-web-fonts': 66.6.6
'@unocss/preset-wind': 66.6.6
'@unocss/preset-wind3': 66.6.6
'@unocss/preset-wind4': 66.6.6
'@unocss/transformer-attributify-jsx': 66.6.6
'@unocss/transformer-compile-class': 66.6.6
'@unocss/transformer-directives': 66.6.6
'@unocss/transformer-variant-group': 66.6.6
'@unocss/vite': 66.6.6(vite@7.3.1(@types/node@25.3.5)(jiti@2.6.1)(sass@1.97.3)(tsx@4.21.0)(yaml@2.8.2))
transitivePeerDependencies:
- vite
unplugin-icons@23.0.1(@vue/compiler-sfc@3.5.29):
dependencies:
'@antfu/install-pkg': 1.1.0

View File

@@ -64,7 +64,7 @@ function toggleSelectAll(checked: boolean) {
<template #trigger>
<NButton size="small">
<template #icon>
<icon-ant-design-setting-outlined class="text-icon" />
<IconAntDesignSettingOutlined class="text-icon" />
</template>
{{ $t('common.columnSetting') }}
</NButton>
@@ -90,7 +90,7 @@ function toggleSelectAll(checked: boolean) {
:class="{ hidden: !item.visible }"
>
<div class="h-full flex-y-center flex-1 rd-4px hover:(bg-primary bg-opacity-20)">
<icon-mdi-drag class="mr-8px h-full cursor-move text-icon" />
<IconMdiDrag class="mr-8px h-full cursor-move text-icon" />
<NCheckbox v-model:checked="item.checked" class="none_draggable flex-1">
<template v-if="typeof item.title === 'function'">
<component :is="item.title" />
@@ -104,9 +104,9 @@ function toggleSelectAll(checked: boolean) {
:tooltip-content="$t(tooltipRecord[item.fixed!])"
@click="handleFixed(item)"
>
<icon-octicon-pin-16 v-if="item.fixed === 'unFixed'" />
<icon-octicon-pin-16 v-else-if="item.fixed === 'left'" class="rotate-270" />
<icon-octicon-pin-slash-16 v-else />
<IconOcticonPin16 v-if="item.fixed === 'unFixed'" />
<IconOcticonPin16 v-else-if="item.fixed === 'left'" class="rotate-270" />
<IconOcticonPinSlash16 v-else />
</ButtonIcon>
</div>
</VueDraggable>

View File

@@ -44,7 +44,7 @@ function refresh() {
<slot name="default">
<NButton size="small" ghost type="primary" @click="add">
<template #icon>
<icon-ic-round-plus class="text-icon" />
<IconIcRoundPlus class="text-icon" />
</template>
{{ $t('common.add') }}
</NButton>
@@ -52,7 +52,7 @@ function refresh() {
<template #trigger>
<NButton size="small" ghost type="error" :disabled="disabledDelete">
<template #icon>
<icon-ic-round-delete class="text-icon" />
<IconIcRoundDelete class="text-icon" />
</template>
{{ $t('common.batchDelete') }}
</NButton>
@@ -62,7 +62,7 @@ function refresh() {
</slot>
<NButton size="small" @click="refresh">
<template #icon>
<icon-mdi-refresh class="text-icon" :class="{ 'animate-spin': loading }" />
<IconMdiRefresh class="text-icon" :class="{ 'animate-spin': loading }" />
</template>
{{ $t('common.refresh') }}
</NButton>

View File

@@ -14,8 +14,8 @@ defineProps<Props>();
<template>
<ButtonIcon :key="String(full)" :tooltip-content="full ? $t('icon.fullscreenExit') : $t('icon.fullscreen')">
<icon-gridicons-fullscreen-exit v-if="full" />
<icon-gridicons-fullscreen v-else />
<IconGridiconsFullscreenExit v-if="full" />
<IconGridiconsFullscreen v-else />
</ButtonIcon>
</template>

View File

@@ -14,7 +14,7 @@ defineProps<Props>();
<template>
<ButtonIcon :tooltip-content="$t('icon.reload')">
<icon-ant-design-reload-outlined :class="{ 'animate-spin animate-duration-750': loading }" />
<IconAntDesignReloadOutlined :class="{ 'animate-spin animate-duration-750': loading }" />
</ButtonIcon>
</template>

View File

@@ -7,16 +7,16 @@ defineOptions({ name: 'SearchFooter' });
<template>
<div class="h-44px flex-y-center gap-14px px-24px">
<span class="flex-y-center">
<icon-mdi-keyboard-return class="operate-shadow operate-item" />
<IconMdiKeyboardReturn class="operate-shadow operate-item" />
<span>{{ $t('common.confirm') }}</span>
</span>
<span class="flex-y-center">
<icon-mdi-arrow-up-thin class="operate-shadow operate-item" />
<icon-mdi-arrow-down-thin class="operate-shadow operate-item" />
<IconMdiArrowUpThin class="operate-shadow operate-item" />
<IconMdiArrowDownThin class="operate-shadow operate-item" />
<span>{{ $t('common.switch') }}</span>
</span>
<span class="flex-y-center">
<icon-mdi-keyboard-esc class="operate-shadow operate-item" />
<IconMdiKeyboardEsc class="operate-shadow operate-item" />
<span>{{ $t('common.close') }}</span>
</span>
</div>

View File

@@ -104,7 +104,7 @@ registerShortcut();
<NInputGroup>
<NInput v-model:value="keyword" clearable :placeholder="$t('common.keywordSearch')" @input="handleSearch">
<template #prefix>
<icon-uil-search class="text-15px text-#c2c2c2" />
<IconUilSearch class="text-15px text-#c2c2c2" />
</template>
</NInput>
<NButton v-if="isMobile" type="primary" ghost @click="handleClose">{{ $t('common.cancel') }}</NButton>

View File

@@ -46,7 +46,7 @@ function handleTo() {
<span class="ml-5px flex-1">
{{ (item.i18nKey && $t(item.i18nKey)) || item.label }}
</span>
<icon-ant-design-enter-outlined class="icon mr-3px p-2px text-20px" />
<IconAntDesignEnterOutlined class="icon mr-3px p-2px text-20px" />
</div>
</template>
</div>

View File

@@ -10,7 +10,7 @@ const { bool: show, toggle } = useBoolean();
<template>
<ButtonIcon :tooltip-content="$t('common.search')" @click="toggle">
<icon-uil-search />
<IconUilSearch />
</ButtonIcon>
<SearchModal v-model:show="show" />
</template>

View File

@@ -68,15 +68,14 @@ const swatches: string[] = [
{{ $t('theme.appearance.themeColor.followPrimary') }}
</NCheckbox>
</template>
<div class="w-90px">
<NColorPicker
:value="themeStore.themeColors[key]"
:disabled="key === 'info' && themeStore.isInfoFollowPrimary"
:show-alpha="false"
:swatches="swatches"
@update:value="handleUpdateColor($event, key)"
/>
</div>
<NColorPicker
class="w-90px"
:value="themeStore.themeColors[key]"
:disabled="key === 'info' && themeStore.isInfoFollowPrimary"
:show-alpha="false"
:swatches="swatches"
@update:value="handleUpdateColor($event, key)"
/>
</SettingItem>
</div>
</template>

View File

@@ -135,7 +135,7 @@ const local: App.I18n.Schema = {
title: 'Tab Settings',
visible: 'Tab Visible',
cache: 'Tag Bar Info Cache',
cacheTip: 'Keep the tab bar information after leaving the page',
cacheTip: 'One-click to open/close global keepalive',
height: 'Tab Height',
mode: {
title: 'Tab Mode',

View File

@@ -132,7 +132,7 @@ const local: App.I18n.Schema = {
title: '标签栏设置',
visible: '显示标签栏',
cache: '标签栏信息缓存',
cacheTip: '离开页面后仍然保留标签栏信息',
cacheTip: '一键开启/关闭全局 keepalive',
height: '标签栏高度',
mode: {
title: '标签栏风格',

View File

@@ -1,11 +1,11 @@
import type { Router } from 'vue-router';
export function createProgressGuard(router: Router) {
router.beforeEach(() => {
router.beforeEach((_to, _from, next) => {
window.NProgress?.start?.();
return;
next();
});
router.afterEach(() => {
router.afterEach(_to => {
window.NProgress?.done?.();
});
}

View File

@@ -1,4 +1,10 @@
import type { LocationQueryRaw, RouteLocationNormalized, RouteLocationRaw, Router } from 'vue-router';
import type {
LocationQueryRaw,
NavigationGuardNext,
RouteLocationNormalized,
RouteLocationRaw,
Router
} from 'vue-router';
import type { RouteKey, RoutePath } from '@elegant-router/types';
import { useAuthStore } from '@/store/modules/auth';
import { useRouteStore } from '@/store/modules/route';
@@ -11,11 +17,12 @@ import { getRouteName } from '@/router/elegant/transform';
* @param router router instance
*/
export function createRouteGuard(router: Router) {
router.beforeEach(async (to, from) => {
router.beforeEach(async (to, from, next) => {
const location = await initRoute(to);
if (location) {
return location;
next(location);
return;
}
const authStore = useAuthStore();
@@ -33,26 +40,30 @@ export function createRouteGuard(router: Router) {
// if it is login route when logged in, then switch to the root page
if (to.name === loginRoute && isLogin) {
return { name: rootRoute };
next({ name: rootRoute });
return;
}
// if the route does not need login, then it is allowed to access directly
if (!needLogin) {
return handleRouteSwitch(to, from);
handleRouteSwitch(to, from, next);
return;
}
// the route need login but the user is not logged in, then switch to the login page
if (!isLogin) {
return { name: loginRoute, query: { redirect: to.fullPath } };
next({ name: loginRoute, query: { redirect: to.fullPath } });
return;
}
// if the user is logged in but does not have authorization, then switch to the 403 page
if (!hasAuth) {
return { name: noAuthorizationRoute };
next({ name: noAuthorizationRoute });
return;
}
// switch route normally
return handleRouteSwitch(to, from);
handleRouteSwitch(to, from, next);
});
}
@@ -150,13 +161,17 @@ async function initRoute(to: RouteLocationNormalized): Promise<RouteLocationRaw
return null;
}
function handleRouteSwitch(to: RouteLocationNormalized, from: RouteLocationNormalized) {
function handleRouteSwitch(to: RouteLocationNormalized, from: RouteLocationNormalized, next: NavigationGuardNext) {
// route with href
if (to.meta.href) {
window.open(to.meta.href, '_blank');
return { path: from.fullPath, replace: true, query: from.query, hash: to.hash };
next({ path: from.fullPath, replace: true, query: from.query, hash: to.hash });
return;
}
next();
}
function getRouteQueryOfLoginRoute(to: RouteLocationNormalized, routeHome: RouteKey) {

View File

@@ -9,7 +9,7 @@ defineOptions({
<template>
<NCard :title="$t('page.home.creativity')" :bordered="false" size="small" class="h-full card-wrapper">
<div class="h-full flex-center">
<icon-local-banner class="text-400px text-primary sm:text-320px" />
<IconLocalBanner class="text-400px text-primary sm:text-320px" />
</div>
</NCard>
</template>

View File

@@ -1,8 +1,12 @@
import { defineConfig, transformerDirectives, transformerVariantGroup, presetWind3 } from 'unocss';
import { defineConfig } from '@unocss/vite';
import transformerDirectives from '@unocss/transformer-directives';
import transformerVariantGroup from '@unocss/transformer-variant-group';
import { presetWind3 } from '@unocss/preset-wind3';
import type { Theme } from '@unocss/preset-uno';
import { presetSoybeanAdmin } from '@sa/uno-preset';
import { themeVars } from './src/theme/vars';
export default defineConfig({
export default defineConfig<Theme>({
content: {
pipeline: {
exclude: ['node_modules', 'dist']