Skip to content

Commit 32f9e24

Browse files
authored
Merge pull request #242 from little3201/develop
优化认证逻辑,修改国际化文件和配置,修改接口请求得函数
2 parents 9554fdb + 7dea3be commit 32f9e24

File tree

108 files changed

+4970
-3671
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

108 files changed

+4970
-3671
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,6 @@ yarn-error.log*
3131

3232
# local .env files
3333
.env.local*
34+
35+
# vitest coverage
36+
/coverage

.husky/commit-msg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pnpm dlx commitlint --edit $1

.husky/pre-commit

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
pnpm run lint:lint-staged
2+
pnpm test

.vscode/extensions.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
{
22
"recommendations": [
3-
"Vue.volar",
43
"dbaeumer.vscode-eslint",
4+
"esbenp.prettier-vscode",
55
"editorconfig.editorconfig",
6+
"vue.volar",
67
"wayou.vscode-todo-highlight"
78
],
89
"unwantedRecommendations": [

.vscode/settings.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
22
"editor.bracketPairColorization.enabled": true,
33
"editor.guides.bracketPairs": true,
4-
"editor.formatOnSave": true,
54
"editor.defaultFormatter": "dbaeumer.vscode-eslint",
65
"editor.codeActionsOnSave": [
76
"source.fixAll.eslint"
@@ -13,5 +12,9 @@
1312
"vue"
1413
],
1514
"typescript.tsdk": "node_modules/typescript/lib",
16-
"eslint.format.enable": true
15+
"eslint.format.enable": true,
16+
"editor.formatOnSave": true,
17+
"[typescript]": {
18+
"editor.defaultFormatter": "vscode.typescript-language-features"
19+
}
1720
}

README.md

Lines changed: 42 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
# Leafage UI
22

3+
<div align="center">
4+
5+
[![license](https://img.shields.io/badge/license-MIT-green.svg)](./LICENSE) [![github stars](https://img.shields.io/github/stars/little3201/leafage-ui)](https://github.com/little3201/leafage-ui/stargazers) [![github forks](https://img.shields.io/github/forks/little3201/leafage-ui)](https://github.com/little3201/leafage-ui/network/members)
6+
7+
</div>
8+
39
<p align="center">
4-
免费且美观的管理模板,使用 Vue 3、Vite、Pinia 和 Tailwind CSS构建。设计用于构建高效、响应式和快速加载的管理界面。
10+
管理模板,使用 Vue 3/React、Vite、Pinia 和 Tailwind CSS构建。设计用于构建高效、响应式和快速加载的管理界面。
511

612
后台接口服务仓库: <a href="https://github.com/little3201/leafage.git">后端服务仓库</a> </br>
713

@@ -12,32 +18,48 @@
1218

1319
### 特性
1420

15-
- **Vue 3、Vite、Pinia 和 Tailwind CSS -** 快速高效的开发
21+
- **Vue 3/React、Vite、Pinia 和 Tailwind CSS -** 快速高效的开发
1622
- **深色主题 -** 现代且引人注目
1723
- **可访问性 -** 包容且用户友好
1824
- **i18n集成 -** 便于全球本地化
19-
- **响应式设计 -** 无缝适应所有设备
20-
- **专业支持 -** 专家提供可靠帮助
25+
- **响应式设计 -** 自适应各种大小的设备
2126
- **高度可定制 -** 可根据项目风格定制
2227

28+
## 技术栈
29+
30+
开发框架:Vue3/React、TypeScript、Vite、Element-Plus/Quasar、Tailwind CSS
31+
测试框架:Vitest
32+
代码规范:Eslint、Husky、Lint-staged、commitlint
33+
2334
### 目录结构
2435

2536
```
37+
├── public/ # Public static assets
38+
│ ├── icons/ # Public icons
39+
│ ├── svgs/ # Public svgs
2640
├── src/
27-
│ ├── api/ # http request api
28-
│ ├── boot/ # Vue composables
29-
│ ├── components/ # Vue components
30-
│ ├── constants/ # Constants
31-
│ ├── i18n/ # i18n
32-
│ ├── layouts/ # Layout components
33-
│ ├── mocks/ # Mocks
34-
│ ├── pages/ # Pages
35-
│ ├── router/ # vue router
36-
│ ├── stores/ # Pinia
37-
│ ├── utils/ # Utils
38-
│ └── App.vue # Root component
39-
├── public/ # Public static assets
40-
├── index.html # Entry HTML file
41-
└── eslint.config.js # Eslint configuration
42-
└── vite.config.js # Vite configuration
41+
│ ├── api/ # http request api
42+
│ ├── assets/ # assets
43+
│ ├── boot/ # plugins init
44+
│ ├── components/ # Vue components
45+
│ ├── constants/ # Constants
46+
│ ├── css/ # css
47+
│ ├── lang/ # i18n languages
48+
│ ├── layouts/ # Layout components
49+
│ ├── mocks/ # Mocks with msw
50+
│ ├── pages/ # Pages
51+
│ ├── router/ # vue router
52+
│ ├── stores/ # Pinia
53+
│ ├── utils/ # Utils
54+
│ └── App.vue # Root component
55+
├── test/ # Test
56+
├── index.html # Entry HTML file
57+
├── .env.development # Env for dev
58+
├── .env.production # Env for prod
59+
└── postcss.config.js # Postcss configuration
60+
└── eslint.config.js # Eslint configuration
61+
└── commitlint.config.js # Commitlint configuration
62+
└── lint-staged.config.js # Lint staged configuration
63+
└── quasar.config.ts # Vite configuration
64+
└── vitest.config.ts # Vitest configuration
4365
```

commitlint.config.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
export default {
2+
extends: ['@commitlint/config-conventional'],
3+
rules: {
4+
'type-enum': [2, 'always',
5+
[
6+
'build',
7+
'chore',
8+
'ci',
9+
'docs',
10+
'feat',
11+
'fix',
12+
'perf',
13+
'refactor',
14+
'revert',
15+
'style',
16+
'test',
17+
]
18+
]
19+
}
20+
}

eslint.config.js

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export default defineConfigWithVueTs(
1717
// ignores: []
1818
},
1919

20-
...pluginQuasar.configs.recommended(),
20+
pluginQuasar.configs.recommended(),
2121
js.configs.recommended,
2222

2323
/**
@@ -32,8 +32,19 @@ export default defineConfigWithVueTs(
3232
* pluginVue.configs["flat/recommended"]
3333
* -> Above, plus rules to enforce subjective community defaults to ensure consistency.
3434
*/
35-
...pluginVue.configs['flat/essential'],
36-
vueTsConfigs.recommended,
35+
pluginVue.configs['flat/essential'],
36+
37+
{
38+
files: ['**/*.ts', '**/*.vue'],
39+
rules: {
40+
'@typescript-eslint/consistent-type-imports': [
41+
'error',
42+
{ prefer: 'type-imports' }
43+
],
44+
}
45+
},
46+
// https://github.com/vuejs/eslint-config-typescript
47+
vueTsConfigs.recommendedTypeChecked,
3748

3849
{
3950
languageOptions: {
@@ -55,11 +66,6 @@ export default defineConfigWithVueTs(
5566
// add your custom rules here
5667
rules: {
5768
'prefer-promise-reject-errors': 'off',
58-
'@typescript-eslint/consistent-type-imports': [
59-
'error',
60-
{ prefer: 'type-imports' }
61-
],
62-
6369
// allow debugger during development only
6470
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off'
6571
}

lint-staged.config.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/**
2+
* @filename: lint-staged.config.js
3+
* @type {import('lint-staged').Configuration}
4+
*/
5+
export default {
6+
'*.{js,mjs,ts,mts,vue}': 'eslint --fix --max-warnings=0',
7+
'*.{ts,tsx}': () => 'tsc --noEmit'
8+
}

package.json

Lines changed: 29 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -7,41 +7,49 @@
77
"private": true,
88
"type": "module",
99
"scripts": {
10-
"lint": "eslint -c ./eslint.config.js './src*/**/*.{ts,js,cjs,mjs,vue}'",
11-
"test": "echo \"No test specified\" && exit 0",
10+
"lint": "eslint -c ./eslint.config.js ./src*/**/*.{js,mjs,cjs,ts,mts,vue}",
1211
"dev": "quasar dev",
13-
"build": "quasar build"
12+
"build": "quasar build",
13+
"test": "vitest",
14+
"coverage": "vitest run --coverage",
15+
"lint:lint-staged": "lint-staged",
16+
"prepare": "husky"
1417
},
1518
"dependencies": {
1619
"@quasar/extras": "^1.17.0",
17-
"apexcharts": "^5.3.5",
18-
"axios": "^1.12.2",
20+
"apexcharts": "^5.3.6",
21+
"axios": "^1.13.2",
1922
"highlight.js": "^11.11.1",
20-
"pinia": "^3.0.3",
21-
"quasar": "^2.18.3",
22-
"vue": "^3.5.21",
23-
"vue-i18n": "^11.1.12",
24-
"vue-router": "^4.5.1"
23+
"pinia": "^3.0.4",
24+
"quasar": "^2.18.6",
25+
"vue": "^3.5.25",
26+
"vue-i18n": "^11.2.2",
27+
"vue-router": "^4.6.3"
2528
},
2629
"devDependencies": {
27-
"@eslint/js": "^9.35.0",
28-
"@lottiefiles/dotlottie-web": "^0.47.0",
30+
"@commitlint/cli": "^20.1.0",
31+
"@commitlint/config-conventional": "^20.0.0",
32+
"@eslint/js": "^9.39.1",
2933
"@quasar/app-vite": "^2.4.0",
30-
"@types/node": "^22.18.5",
34+
"@types/node": "^22.19.1",
35+
"@vitest/coverage-v8": "^4.0.15",
3136
"@vue/eslint-config-typescript": "^14.6.0",
32-
"autoprefixer": "^10.4.21",
33-
"eslint": "^9.35.0",
34-
"eslint-plugin-vue": "^10.4.0",
35-
"globals": "^16.4.0",
36-
"msw": "^2.11.2",
37+
"autoprefixer": "^10.4.22",
38+
"eslint": "^9.39.1",
39+
"eslint-plugin-vue": "^10.6.2",
40+
"globals": "^16.5.0",
41+
"husky": "^9.1.7",
42+
"lint-staged": "^16.2.7",
43+
"msw": "^2.12.3",
3744
"typescript": "~5.8.3",
38-
"vite-plugin-checker": "^0.10.3",
39-
"vue-tsc": "^3.0.7"
45+
"vite-plugin-checker": "^0.11.0",
46+
"vitest": "^4.0.15",
47+
"vue-tsc": "^3.1.5"
4048
},
4149
"msw": {
4250
"workerDirectory": [
4351
"public"
4452
]
4553
},
4654
"packageManager": "pnpm@10.8.0"
47-
}
55+
}

0 commit comments

Comments
 (0)