Compare commits
41 Commits
tauri-v1.1
...
tauri-v1.2
Author | SHA1 | Date | |
---|---|---|---|
|
1bd769f1c0 | ||
|
22004ff4dc | ||
|
08827a42a3 | ||
|
6a6eb9afd6 | ||
|
ff51b72dac | ||
|
fe06b8c499 | ||
|
4b63bbcf67 | ||
|
5531a68641 | ||
|
584cd54d6d | ||
|
2bec899031 | ||
|
83862ba76e | ||
|
060c0a91c7 | ||
|
76649e2a08 | ||
|
ddf3823a55 | ||
|
e75fd73f34 | ||
|
1f4647b995 | ||
|
910dfca8bb | ||
|
ffb48b15bc | ||
|
e6086f0f35 | ||
|
9b05d73e6d | ||
|
bd69c00e74 | ||
|
d08a3817d1 | ||
|
d0380ce5cb | ||
|
756f84ab1d | ||
|
5a4f844d24 | ||
|
59faf15229 | ||
|
5bd96b8dd3 | ||
|
8efdb10d86 | ||
|
2aa85c6f93 | ||
|
3ad438984e | ||
|
f1850416c8 | ||
|
086bad474e | ||
|
42b121a117 | ||
|
db64b0e2e9 | ||
|
40d0f8ac1c | ||
|
87b18386f5 | ||
|
4c1c7e6599 | ||
|
ac78b9a394 | ||
|
e379d6ce67 | ||
|
64fc0996e3 | ||
|
bc8dc47d7f |
@@ -1,5 +1,5 @@
|
|||||||
# backend service base url, prod environment
|
# backend service base url, prod environment
|
||||||
VITE_SERVICE_BASE_URL=https://mock.apifox.com/m1/3109515-0-default
|
VITE_SERVICE_BASE_URL=https://mock.apifox.cn/m1/3109515-0-default
|
||||||
|
|
||||||
# other backend service base url, prod environment
|
# other backend service base url, prod environment
|
||||||
VITE_OTHER_SERVICE_BASE_URL= `{
|
VITE_OTHER_SERVICE_BASE_URL= `{
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
# backend service base url, test environment
|
# backend service base url, test environment
|
||||||
VITE_SERVICE_BASE_URL=https://mock.apifox.com/m1/3109515-0-default
|
VITE_SERVICE_BASE_URL=https://mock.apifox.cn/m1/3109515-0-default
|
||||||
|
|
||||||
# other backend service base url, test environment
|
# other backend service base url, test environment
|
||||||
VITE_OTHER_SERVICE_BASE_URL= `{
|
VITE_OTHER_SERVICE_BASE_URL= `{
|
||||||
|
2
.vscode/launch.json
vendored
@@ -12,7 +12,7 @@
|
|||||||
"type": "node",
|
"type": "node",
|
||||||
"request": "launch",
|
"request": "launch",
|
||||||
"name": "TS Debugger",
|
"name": "TS Debugger",
|
||||||
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/tsx",
|
"runtimeExecutable": "tsx",
|
||||||
"skipFiles": ["<node_internals>/**", "${workspaceFolder}/node_modules/**"],
|
"skipFiles": ["<node_internals>/**", "${workspaceFolder}/node_modules/**"],
|
||||||
"program": "${file}"
|
"program": "${file}"
|
||||||
}
|
}
|
||||||
|
3
.vscode/settings.json
vendored
@@ -14,5 +14,6 @@
|
|||||||
"i18n-ally.localesPaths": ["src/locales/langs"],
|
"i18n-ally.localesPaths": ["src/locales/langs"],
|
||||||
"prettier.enable": false,
|
"prettier.enable": false,
|
||||||
"typescript.tsdk": "node_modules/typescript/lib",
|
"typescript.tsdk": "node_modules/typescript/lib",
|
||||||
"unocss.root": ["./"]
|
"unocss.root": ["./"],
|
||||||
|
"vue.server.hybridMode": true
|
||||||
}
|
}
|
||||||
|
131
CHANGELOG.md
@@ -1,6 +1,137 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
|
||||||
|
## [v1.2.1](https://github.com/honghuangdc/soybean-admin/compare/v1.2.0...v1.2.1) (2024-06-07)
|
||||||
|
|
||||||
|
### 🐞 Bug Fixes
|
||||||
|
|
||||||
|
- **projects**:
|
||||||
|
- fix get user info when page reload - by @soybeanjs [<samp>(ff51b)</samp>](https://github.com/honghuangdc/soybean-admin/commit/ff51b72)
|
||||||
|
- fix setupAppVersionNotification render - by @soybeanjs [<samp>(6a6eb)</samp>](https://github.com/honghuangdc/soybean-admin/commit/6a6eb9a)
|
||||||
|
|
||||||
|
### 📖 Documentation
|
||||||
|
|
||||||
|
- **projects**: update CHANGELOG - by @soybeanjs [<samp>(fe06b)</samp>](https://github.com/honghuangdc/soybean-admin/commit/fe06b8c)
|
||||||
|
|
||||||
|
### 🏡 Chore
|
||||||
|
|
||||||
|
- **deps**: update deps - by @soybeanjs [<samp>(08827)</samp>](https://github.com/honghuangdc/soybean-admin/commit/08827a4)
|
||||||
|
|
||||||
|
### ❤️ Contributors
|
||||||
|
|
||||||
|
[](https://github.com/soybeanjs)
|
||||||
|
|
||||||
|
## [v1.2.0](https://github.com/soybeanjs/soybean-admin/compare/v1.1.5...v1.2.0) (2024-06-06)
|
||||||
|
|
||||||
|
### 🚀 Features
|
||||||
|
|
||||||
|
- **projects**:
|
||||||
|
- support system new version update notification. close #420 - by @soybeanjs in https://github.com/soybeanjs/soybean-admin/issues/420 [<samp>(584cd)</samp>](https://github.com/soybeanjs/soybean-admin/commit/584cd54)
|
||||||
|
- get user info in router guard and remove in localStorage. close #459 - by @soybeanjs in https://github.com/soybeanjs/soybean-admin/issues/459 [<samp>(5531a)</samp>](https://github.com/soybeanjs/soybean-admin/commit/5531a68)
|
||||||
|
|
||||||
|
### 📖 Documentation
|
||||||
|
|
||||||
|
- **projects**: update CHANGELOG - by @soybeanjs [<samp>(2bec8)</samp>](https://github.com/soybeanjs/soybean-admin/commit/2bec899)
|
||||||
|
|
||||||
|
### ❤️ Contributors
|
||||||
|
|
||||||
|
[](https://github.com/soybeanjs)
|
||||||
|
|
||||||
|
## [v1.1.5](https://github.com/soybeanjs/soybean-admin/compare/v1.1.4...v1.1.5) (2024-06-06)
|
||||||
|
|
||||||
|
### 🐞 Bug Fixes
|
||||||
|
|
||||||
|
- **projects**: fix register name, CodeLogin => Register - by @m-xlsea in https://github.com/soybeanjs/soybean-admin/issues/478 [<samp>(ddf38)</samp>](https://github.com/soybeanjs/soybean-admin/commit/ddf3823)
|
||||||
|
|
||||||
|
### 🏡 Chore
|
||||||
|
|
||||||
|
- **deps**: update deps - by @soybeanjs [<samp>(060c0)</samp>](https://github.com/soybeanjs/soybean-admin/commit/060c0a9)
|
||||||
|
- **projects**: update vscode settings: vue official - by @soybeanjs [<samp>(76649)</samp>](https://github.com/soybeanjs/soybean-admin/commit/76649e2)
|
||||||
|
|
||||||
|
### ❤️ Contributors
|
||||||
|
|
||||||
|
[](https://github.com/soybeanjs) [](https://github.com/m-xlsea)
|
||||||
|
|
||||||
|
## [v1.1.4](https://github.com/honghuangdc/soybean-admin/compare/v1.1.3...v1.1.4) (2024-06-06)
|
||||||
|
|
||||||
|
### 🐞 Bug Fixes
|
||||||
|
|
||||||
|
- **utils**: modalLogout bug when esc is pressed - by @sigma-plus in https://github.com/honghuangdc/soybean-admin/issues/470 [<samp>(bd69c)</samp>](https://github.com/honghuangdc/soybean-admin/commit/bd69c00)
|
||||||
|
|
||||||
|
### 🛠 Optimizations
|
||||||
|
|
||||||
|
- **projects**: optimize RouteMeta remarks - by @soybeanjs [<samp>(ffb48)</samp>](https://github.com/honghuangdc/soybean-admin/commit/ffb48b1)
|
||||||
|
|
||||||
|
### 📖 Documentation
|
||||||
|
|
||||||
|
- **projects**:
|
||||||
|
- update CHANGELOG - by @soybeanjs [<samp>(756f8)</samp>](https://github.com/honghuangdc/soybean-admin/commit/756f84a)
|
||||||
|
- update Node&pnpm version - by @Azir-11 in https://github.com/honghuangdc/soybean-admin/issues/472 [<samp>(9b05d)</samp>](https://github.com/honghuangdc/soybean-admin/commit/9b05d73)
|
||||||
|
|
||||||
|
### 🏡 Chore
|
||||||
|
|
||||||
|
- **deps**:
|
||||||
|
- update deps - by @soybeanjs [<samp>(d0380)</samp>](https://github.com/honghuangdc/soybean-admin/commit/d0380ce)
|
||||||
|
- update deps - by @soybeanjs [<samp>(1f464)</samp>](https://github.com/honghuangdc/soybean-admin/commit/1f4647b)
|
||||||
|
- **projects**:
|
||||||
|
- close http proxy - by @soybeanjs [<samp>(d08a3)</samp>](https://github.com/honghuangdc/soybean-admin/commit/d08a381)
|
||||||
|
- update mock url - by @soybeanjs [<samp>(e6086)</samp>](https://github.com/honghuangdc/soybean-admin/commit/e6086f0)
|
||||||
|
- update vscode settings - by @soybeanjs [<samp>(910df)</samp>](https://github.com/honghuangdc/soybean-admin/commit/910dfca)
|
||||||
|
|
||||||
|
### ❤️ Contributors
|
||||||
|
|
||||||
|
[](https://github.com/soybeanjs) [](https://github.com/Azir-11) [](https://github.com/sigma-plus)
|
||||||
|
|
||||||
|
## [v1.1.3](https://github.com/soybeanjs/soybean-admin/compare/v1.1.2...v1.1.3) (2024-06-02)
|
||||||
|
|
||||||
|
### 🐞 Bug Fixes
|
||||||
|
|
||||||
|
- **components**:
|
||||||
|
- Fix the issue of search box popping up repeatedly due to carriage return - by @Azir-11 in https://github.com/soybeanjs/soybean-admin/issues/468 [<samp>(5bd96)</samp>](https://github.com/soybeanjs/soybean-admin/commit/5bd96b8)
|
||||||
|
- **projects**:
|
||||||
|
- fix click menu search. fixed #466, close #467 - by @soybeanjs in https://github.com/soybeanjs/soybean-admin/issues/466 and https://github.com/soybeanjs/soybean-admin/issues/467 [<samp>(8efdb)</samp>](https://github.com/soybeanjs/soybean-admin/commit/8efdb10)
|
||||||
|
- fix reCacheRoute. fixed #464 - by @soybeanjs in https://github.com/soybeanjs/soybean-admin/issues/464 [<samp>(59faf)</samp>](https://github.com/soybeanjs/soybean-admin/commit/59faf15)
|
||||||
|
- **styles**:
|
||||||
|
- fix FirstLevelMenu style. fixed #450 - by @soybeanjs in https://github.com/soybeanjs/soybean-admin/issues/450 [<samp>(db64b)</samp>](https://github.com/soybeanjs/soybean-admin/commit/db64b0e)
|
||||||
|
- fix PinToggler style. fixed #451 - by @soybeanjs in https://github.com/soybeanjs/soybean-admin/issues/451 [<samp>(42b12)</samp>](https://github.com/soybeanjs/soybean-admin/commit/42b121a)
|
||||||
|
|
||||||
|
### 🛠 Optimizations
|
||||||
|
|
||||||
|
- **components**: accuracy draggable area for TableColumnSetting with animation - by @orangelckc in https://github.com/soybeanjs/soybean-admin/issues/465 [<samp>(2aa85)</samp>](https://github.com/soybeanjs/soybean-admin/commit/2aa85c6)
|
||||||
|
- **projects**: unocss border shortcut - by @soybeanjs [<samp>(40d0f)</samp>](https://github.com/soybeanjs/soybean-admin/commit/40d0f8a)
|
||||||
|
|
||||||
|
### 📖 Documentation
|
||||||
|
|
||||||
|
- **projects**: update CHANGELOG - by @soybeanjs [<samp>(87b18)</samp>](https://github.com/soybeanjs/soybean-admin/commit/87b1838)
|
||||||
|
|
||||||
|
### 🏡 Chore
|
||||||
|
|
||||||
|
- **other**:
|
||||||
|
- correct spell mistake - by @orangelckc in https://github.com/soybeanjs/soybean-admin/issues/460 [<samp>(086ba)</samp>](https://github.com/soybeanjs/soybean-admin/commit/086bad4)
|
||||||
|
- correct spell mistake - by @Azir-11 in https://github.com/soybeanjs/soybean-admin/issues/462 [<samp>(f1850)</samp>](https://github.com/soybeanjs/soybean-admin/commit/f185041)
|
||||||
|
- **projects**:
|
||||||
|
- update vscode launch.json - by @soybeanjs [<samp>(4c1c7)</samp>](https://github.com/soybeanjs/soybean-admin/commit/4c1c7e6)
|
||||||
|
|
||||||
|
### ❤️ Contributors
|
||||||
|
|
||||||
|
[](https://github.com/soybeanjs) [](https://github.com/Azir-11) [](https://github.com/orangelckc)
|
||||||
|
|
||||||
|
## [v1.1.2](https://github.com/soybeanjs/soybean-admin/compare/v1.1.1...v1.1.2) (2024-05-24)
|
||||||
|
|
||||||
|
### 🐞 Bug Fixes
|
||||||
|
|
||||||
|
- **projects**:
|
||||||
|
- fix header style & fix button highlight when click global-tab. fixed #446 - by @honghuangdc in https://github.com/soybeanjs/soybean-admin/issues/446 [<samp>(64fc0)</samp>](https://github.com/soybeanjs/soybean-admin/commit/64fc099)
|
||||||
|
- fix multi tab page only render once. fixed #441 - by @honghuangdc in https://github.com/soybeanjs/soybean-admin/issues/441 [<samp>(e379d)</samp>](https://github.com/soybeanjs/soybean-admin/commit/e379d6c)
|
||||||
|
|
||||||
|
### 🛠 Optimizations
|
||||||
|
|
||||||
|
- **projects**: optimize code - by @honghuangdc [<samp>(bc8dc)</samp>](https://github.com/soybeanjs/soybean-admin/commit/bc8dc47)
|
||||||
|
|
||||||
|
### ❤️ Contributors
|
||||||
|
|
||||||
|
[](https://github.com/honghuangdc)
|
||||||
|
|
||||||
## [v1.1.1](https://github.com/soybeanjs/soybean-admin/compare/v1.1.0...v1.1.1) (2024-05-20)
|
## [v1.1.1](https://github.com/soybeanjs/soybean-admin/compare/v1.1.0...v1.1.1) (2024-05-20)
|
||||||
|
|
||||||
### 🚀 Features
|
### 🚀 Features
|
||||||
|
@@ -1,6 +1,149 @@
|
|||||||
# 更新日志
|
# 更新日志
|
||||||
|
|
||||||
|
|
||||||
|
## [v1.2.0](https://github.com/soybeanjs/soybean-admin/compare/v1.1.5...v1.2.0) (2024-06-06)
|
||||||
|
|
||||||
|
### 🚀 功能
|
||||||
|
|
||||||
|
- **项目**:
|
||||||
|
- 支持系统新版本更新通知。关闭 #420 - 由 @soybeanjs 在 https://github.com/soybeanjs/soybean-admin/issues/420 [<samp>(584cd)</samp>](https://github.com/soybeanjs/soybean-admin/commit/584cd54)
|
||||||
|
- 在路由守卫中获取用户信息并从localStorage中移除。关闭 #459 - 由 @soybeanjs 在 https://github.com/soybeanjs/soybean-admin/issues/459 [<samp>(5531a)</samp>](https://github.com/soybeanjs/soybean-admin/commit/5531a68)
|
||||||
|
|
||||||
|
### 📖 文档
|
||||||
|
|
||||||
|
- **项目**: 更新CHANGELOG - 由 @soybeanjs [<samp>(2bec8)</samp>](https://github.com/soybeanjs/soybean-admin/commit/2bec899)
|
||||||
|
|
||||||
|
### ❤️ 贡献者
|
||||||
|
|
||||||
|
[](https://github.com/soybeanjs)
|
||||||
|
|
||||||
|
## [v1.1.5](https://github.com/soybeanjs/soybean-admin/compare/v1.1.4...v1.1.5) (2024-06-06)
|
||||||
|
|
||||||
|
### 🐞 错误修复
|
||||||
|
|
||||||
|
- **项目**: 修复注册组件名,CodeLogin => Register - 由 @m-xlsea 在 https://github.com/soybeanjs/soybean-admin/issues/478 [<samp>(ddf38)</samp>](https://github.com/soybeanjs/soybean-admin/commit/ddf3823)
|
||||||
|
|
||||||
|
### 🏡 杂务
|
||||||
|
|
||||||
|
- **依赖**: 更新依赖 - 由 @soybeanjs [<samp>(060c0)</samp>](https://github.com/soybeanjs/soybean-admin/commit/060c0a9)
|
||||||
|
- **项目**: 更新 vscode 设置: vue 官方 - 由 @soybeanjs [<samp>(76649)</samp>](https://github.com/soybeanjs/soybean-admin/commit/76649e2)
|
||||||
|
|
||||||
|
### ❤️ 贡献者
|
||||||
|
|
||||||
|
[](https://github.com/soybeanjs) [](https://github.com/m-xlsea)
|
||||||
|
|
||||||
|
## [v1.1.4](https://github.com/honghuangdc/soybean-admin/compare/v1.1.3...v1.1.4) (2024-06-06)
|
||||||
|
|
||||||
|
### 🐞 错误修复
|
||||||
|
|
||||||
|
- **utils**: 修复了按esc键时modalLogout的错误 - 由 @sigma-plus 在 https://github.com/honghuangdc/soybean-admin/issues/470 中提出 [<samp>(bd69c)</samp>](https://github.com/honghuangdc/soybean-admin/commit/bd69c00)
|
||||||
|
|
||||||
|
### 🛠 优化
|
||||||
|
|
||||||
|
- **projects**: 优化了RouteMeta的备注 - 由 @soybeanjs 提出 [<samp>(ffb48)</samp>](https://github.com/honghuangdc/soybean-admin/commit/ffb48b1)
|
||||||
|
|
||||||
|
### 📖 文档
|
||||||
|
|
||||||
|
- **projects**:
|
||||||
|
- 更新了CHANGELOG - 由 @soybeanjs 提出 [<samp>(756f8)</samp>](https://github.com/honghuangdc/soybean-admin/commit/756f84a)
|
||||||
|
- 更新了Node&pnpm版本 - 由 @Azir-11 在 https://github.com/honghuangdc/soybean-admin/issues/472 中提出 [<samp>(9b05d)</samp>](https://github.com/honghuangdc/soybean-admin/commit/9b05d73)
|
||||||
|
|
||||||
|
### 🏡 杂项
|
||||||
|
|
||||||
|
- **deps**:
|
||||||
|
- 更新了依赖 - 由 @soybeanjs 提出 [<samp>(d0380)</samp>](https://github.com/honghuangdc/soybean-admin/commit/d0380ce)
|
||||||
|
- 更新了依赖 - 由 @soybeanjs 提出 [<samp>(1f464)</samp>](https://github.com/honghuangdc/soybean-admin/commit/1f4647b)
|
||||||
|
- **projects**:
|
||||||
|
- 关闭了http代理 - 由 @soybeanjs 提出 [<samp>(d08a3)</samp>](https://github.com/honghuangdc/soybean-admin/commit/d08a381)
|
||||||
|
- 更新了mock url - 由 @soybeanjs 提出 [<samp>(e6086)</samp>](https://github.com/honghuangdc/soybean-admin/commit/e6086f0)
|
||||||
|
- 更新了vscode设置 - 由 @soybeanjs 提出 [<samp>(910df)</samp>](https://github.com/honghuangdc/soybean-admin/commit/910dfca)
|
||||||
|
|
||||||
|
### ❤️ 贡献者
|
||||||
|
|
||||||
|
[](https://github.com/soybeanjs) [](https://github.com/Azir-11) [](https://github.com/sigma-plus)
|
||||||
|
|
||||||
|
## [v1.1.3](https://github.com/soybeanjs/soybean-admin/compare/v1.1.2...v1.1.3) (2024-06-02)
|
||||||
|
|
||||||
|
### 🐞 错误修复
|
||||||
|
|
||||||
|
- **组件**:
|
||||||
|
- 修复了由于回车导致搜索框反复弹出的问题 - 由 @Azir-11 在 https://github.com/soybeanjs/soybean-admin/issues/468 中修复 [<samp>(5bd96)</samp>](https://github.com/soybeanjs/soybean-admin/commit/5bd96b8)
|
||||||
|
- **项目**:
|
||||||
|
- 修复点击菜单搜索。修复了 #466,关闭 #467 - 由 @soybeanjs 在 https://github.com/soybeanjs/soybean-admin/issues/466 和 https://github.com/soybeanjs/soybean-admin/issues/467 中修复 [<samp>(8efdb)</samp>](https://github.com/soybeanjs/soybean-admin/commit/8efdb10)
|
||||||
|
- 修复 reCacheRoute。修复了 #464 - 由 @soybeanjs 在 https://github.com/soybeanjs/soybean-admin/issues/464 中修复 [<samp>(59faf)</samp>](https://github.com/soybeanjs/soybean-admin/commit/59faf15)
|
||||||
|
- **样式**:
|
||||||
|
- 修复 FirstLevelMenu 样式。修复了 #450 - 由 @soybeanjs 在 https://github.com/soybeanjs/soybean-admin/issues/450 中修复 [<samp>(db64b)</samp>](https://github.com/soybeanjs/soybean-admin/commit/db64b0e)
|
||||||
|
- 修复 PinToggler 样式。修复了 #451 - 由 @soybeanjs 在 https://github.com/soybeanjs/soybean-admin/issues/451 中修复 [<samp>(42b12)</samp>](https://github.com/soybeanjs/soybean-admin/commit/42b121a)
|
||||||
|
|
||||||
|
### 🛠 优化
|
||||||
|
|
||||||
|
- **组件**: 提高 TableColumnSetting 的拖动区域精度,带有动画 - 由 @orangelckc 在 https://github.com/soybeanjs/soybean-admin/issues/465 中优化 [<samp>(2aa85)</samp>](https://github.com/soybeanjs/soybean-admin/commit/2aa85c6)
|
||||||
|
- **项目**: unocss 边框快捷方式 - 由 @soybeanjs 优化 [<samp>(40d0f)</samp>](https://github.com/soybeanjs/soybean-admin/commit/40d0f8a)
|
||||||
|
|
||||||
|
### 📖 文档
|
||||||
|
|
||||||
|
- **项目**: 更新 CHANGELOG - 由 @soybeanjs 更新 [<samp>(87b18)</samp>](https://github.com/soybeanjs/soybean-admin/commit/87b1838)
|
||||||
|
|
||||||
|
### 🏡 杂项
|
||||||
|
|
||||||
|
- **其他**:
|
||||||
|
- 纠正拼写错误 - 由 @orangelckc 在 https://github.com/soybeanjs/soybean-admin/issues/460 中纠正 [<samp>(086ba)</samp>](https://github.com/soybeanjs/soybean-admin/commit/086bad4)
|
||||||
|
- 纠正拼写错误 - 由 @Azir-11 在 https://github.com/soybeanjs/soybean-admin/issues/462 中纠正 [<samp>(f1850)</samp>](https://github.com/soybeanjs/soybean-admin/commit/f185041)
|
||||||
|
- **项目**:
|
||||||
|
- 更新 vscode launch.json - 由 @soybeanjs 更新 [<samp>(4c1c7)</samp>](https://github.com/soybeanjs/soybean-admin/commit/4c1c7e6)
|
||||||
|
|
||||||
|
### ❤️ 贡献者
|
||||||
|
|
||||||
|
[](https://github.com/soybeanjs) [](https://github.com/Azir-11) [](https://github.com/orangelckc)
|
||||||
|
|
||||||
|
## [v1.1.2](https://github.com/soybeanjs/soybean-admin/compare/v1.1.1...v1.1.2) (2024-05-24)
|
||||||
|
|
||||||
|
### 🐞 错误修复
|
||||||
|
|
||||||
|
- **项目**:
|
||||||
|
- 修复头部样式 & 修复点击全局标签时按钮高亮。修复了 #446 - 由 @honghuangdc 在 https://github.com/soybeanjs/soybean-admin/issues/446 [<samp>(64fc0)</samp>](https://github.com/soybeanjs/soybean-admin/commit/64fc099)
|
||||||
|
- 修复多标签页只渲染一次。修复了 #441 - 由 @honghuangdc 在 https://github.com/soybeanjs/soybean-admin/issues/441 [<samp>(e379d)</samp>](https://github.com/soybeanjs/soybean-admin/commit/e379d6c)
|
||||||
|
|
||||||
|
### 🛠 优化
|
||||||
|
|
||||||
|
- **项目**: 优化代码 - 由 @honghuangdc [<samp>(bc8dc)</samp>](https://github.com/soybeanjs/soybean-admin/commit/bc8dc47)
|
||||||
|
|
||||||
|
### ❤️ 贡献者
|
||||||
|
|
||||||
|
[](https://github.com/honghuangdc)
|
||||||
|
|
||||||
|
## [v1.1.1](https://github.com/soybeanjs/soybean-admin/compare/v1.1.0...v1.1.1) (2024-05-20)
|
||||||
|
|
||||||
|
### 🚀 功能
|
||||||
|
|
||||||
|
- **hooks**: 为 useEcharts 添加 setOptions - 由 @honghuangdc 提交 [<samp>(e4d53)</samp>](https://github.com/soybeanjs/soybean-admin/commit/e4d53aa)
|
||||||
|
|
||||||
|
### 🐞 修复错误
|
||||||
|
|
||||||
|
- **projects**:
|
||||||
|
- 修复 useRouter。修复了 #436 - 由 @honghuangdc 在 https://github.com/soybeanjs/soybean-admin/issues/436 提交 [<samp>(0774a)</samp>](https://github.com/soybeanjs/soybean-admin/commit/0774a51)
|
||||||
|
- 在动态路由模式下获取路由时添加错误处理。修复了 440 - 由 @honghuangdc 提交 [<samp>(57b4a)</samp>](https://github.com/soybeanjs/soybean-admin/commit/57b4a9d)
|
||||||
|
- **styles**:
|
||||||
|
- 修复 useTable 类型 - 由 @honghuangdc 提交 [<samp>(07124)</samp>](https://github.com/soybeanjs/soybean-admin/commit/071241f)
|
||||||
|
|
||||||
|
### 📖 文档
|
||||||
|
|
||||||
|
- **projects**:
|
||||||
|
- 更新 CHANGELOG - 由 @honghuangdc 提交 [<samp>(19783)</samp>](https://github.com/soybeanjs/soybean-admin/commit/1978397)
|
||||||
|
- 更新 README.md - 由 @honghuangdc 提交 [<samp>(fa56e)</samp>](https://github.com/soybeanjs/soybean-admin/commit/fa56e9c)
|
||||||
|
- 更新 README.md - 由 @honghuangdc 提交 [<samp>(419ea)</samp>](https://github.com/soybeanjs/soybean-admin/commit/419ea42)
|
||||||
|
|
||||||
|
### 🏡 杂项
|
||||||
|
|
||||||
|
- **projects**:
|
||||||
|
- 更新依赖并修复 TS 错误 - 由 @honghuangdc 提交 [<samp>(4ea9c)</samp>](https://github.com/soybeanjs/soybean-admin/commit/4ea9c85)
|
||||||
|
- 更新 eslint-config 并修复代码 - 由 @honghuangdc 提交 [<samp>(68ea9)</samp>](https://github.com/soybeanjs/soybean-admin/commit/68ea974)
|
||||||
|
- 更新 @elegant-router/vue 并为 resolve route 添加错误处理。修复了 #442 - 由 @honghuangdc 在 https://github.com/soybeanjs/soybean-admin/issues/442 提交 [<samp>(24ff8)</samp>](https://github.com/soybeanjs/soybean-admin/commit/24ff852)
|
||||||
|
|
||||||
|
### ❤️ 贡献者
|
||||||
|
|
||||||
|
[](https://github.com/honghuangdc)
|
||||||
|
|
||||||
## [v1.1.0](https://github.com/honghuangdc/soybean-admin/compare/v1.0.9...v1.1.0) (2024-05-07)
|
## [v1.1.0](https://github.com/honghuangdc/soybean-admin/compare/v1.0.9...v1.1.0) (2024-05-07)
|
||||||
|
|
||||||
### 🚀 功能
|
### 🚀 功能
|
||||||
|
@@ -78,8 +78,8 @@
|
|||||||
Make sure your environment meets the following requirements:
|
Make sure your environment meets the following requirements:
|
||||||
|
|
||||||
- **git**: you need git to clone and manage project versions.
|
- **git**: you need git to clone and manage project versions.
|
||||||
- **NodeJS**: >=18.0.0, recommended 18.19.0 or higher.
|
- **NodeJS**: >=18.12.0, recommended 18.19.0 or higher.
|
||||||
- **pnpm**: >= 8.0.0, recommended 8.14.0 or higher.
|
- **pnpm**: >= 8.7.0, recommended 8.14.0 or higher.
|
||||||
|
|
||||||
**Clone Project**
|
**Clone Project**
|
||||||
|
|
||||||
|
@@ -77,8 +77,8 @@
|
|||||||
确保你的环境满足以下要求:
|
确保你的环境满足以下要求:
|
||||||
|
|
||||||
- **git**: 你需要git来克隆和管理项目版本。
|
- **git**: 你需要git来克隆和管理项目版本。
|
||||||
- **NodeJS**: >=18.0.0,推荐 18.19.0 或更高。
|
- **NodeJS**: >=18.12.0,推荐 18.19.0 或更高。
|
||||||
- **pnpm**: >= 8.0.0,推荐 8.14.0 或更高。
|
- **pnpm**: >= 8.7.0,推荐 8.14.0 或更高。
|
||||||
|
|
||||||
**克隆项目**
|
**克隆项目**
|
||||||
|
|
||||||
|
13
build/plugins/html.ts
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
import type { Plugin } from 'vite';
|
||||||
|
|
||||||
|
export function setupHtmlPlugin(buildTime: string) {
|
||||||
|
const plugin: Plugin = {
|
||||||
|
name: 'html-plugin',
|
||||||
|
apply: 'build',
|
||||||
|
transformIndexHtml(html) {
|
||||||
|
return html.replace('<head>', `<head>\n <meta name="buildTime" content="${buildTime}">`);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
return plugin;
|
||||||
|
}
|
@@ -6,8 +6,9 @@ import progress from 'vite-plugin-progress';
|
|||||||
import { setupElegantRouter } from './router';
|
import { setupElegantRouter } from './router';
|
||||||
import { setupUnocss } from './unocss';
|
import { setupUnocss } from './unocss';
|
||||||
import { setupUnplugin } from './unplugin';
|
import { setupUnplugin } from './unplugin';
|
||||||
|
import { setupHtmlPlugin } from './html';
|
||||||
|
|
||||||
export function setupVitePlugins(viteEnv: Env.ImportMeta) {
|
export function setupVitePlugins(viteEnv: Env.ImportMeta, buildTime: string) {
|
||||||
const plugins: PluginOption = [
|
const plugins: PluginOption = [
|
||||||
vue({
|
vue({
|
||||||
script: {
|
script: {
|
||||||
@@ -19,7 +20,8 @@ export function setupVitePlugins(viteEnv: Env.ImportMeta) {
|
|||||||
setupElegantRouter(),
|
setupElegantRouter(),
|
||||||
setupUnocss(viteEnv),
|
setupUnocss(viteEnv),
|
||||||
...setupUnplugin(viteEnv),
|
...setupUnplugin(viteEnv),
|
||||||
progress()
|
progress(),
|
||||||
|
setupHtmlPlugin(buildTime)
|
||||||
];
|
];
|
||||||
|
|
||||||
return plugins;
|
return plugins;
|
||||||
|
@@ -1,13 +1,13 @@
|
|||||||
import { defineConfig } from '@soybeanjs/eslint-config';
|
import { defineConfig } from '@soybeanjs/eslint-config';
|
||||||
|
|
||||||
export default defineConfig(
|
export default defineConfig(
|
||||||
{ vue: true, unocss: true },
|
{ vue: true, unocss: true, ignores: ['src-tauri/target'] },
|
||||||
{
|
{
|
||||||
rules: {
|
rules: {
|
||||||
'vue/multi-word-component-names': [
|
'vue/multi-word-component-names': [
|
||||||
'warn',
|
'warn',
|
||||||
{
|
{
|
||||||
ignores: ['index', 'App', '[id]', '[url]']
|
ignores: ['index', 'App', 'Register', '[id]', '[url]']
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
'vue/component-name-in-template-casing': [
|
'vue/component-name-in-template-casing': [
|
||||||
|
47
package.json
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "soybean-admin",
|
"name": "soybean-admin",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"version": "1.1.1",
|
"version": "1.2.1",
|
||||||
"description": "A fresh and elegant admin template, based on Vue3、Vite3、TypeScript、NaiveUI and UnoCSS. 一个基于Vue3、Vite3、TypeScript、NaiveUI and UnoCSS的清新优雅的中后台模版。",
|
"description": "A fresh and elegant admin template, based on Vue3、Vite3、TypeScript、NaiveUI and UnoCSS. 一个基于Vue3、Vite3、TypeScript、NaiveUI and UnoCSS的清新优雅的中后台模版。",
|
||||||
"author": {
|
"author": {
|
||||||
"name": "Soybean",
|
"name": "Soybean",
|
||||||
@@ -32,16 +32,19 @@
|
|||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "vite build --mode prod",
|
"build": "vite build --mode prod",
|
||||||
|
"build:tauri": "pnpm tauri build",
|
||||||
"build:test": "vite build --mode test",
|
"build:test": "vite build --mode test",
|
||||||
"cleanup": "sa cleanup",
|
"cleanup": "sa cleanup",
|
||||||
"commit": "sa git-commit",
|
"commit": "sa git-commit",
|
||||||
"dev": "vite --mode test",
|
"dev": "vite --mode test",
|
||||||
"dev:prod": "vite --mode prod",
|
"dev:prod": "vite --mode prod",
|
||||||
|
"dev:tauri": "pnpm tauri dev",
|
||||||
"gen-route": "sa gen-route",
|
"gen-route": "sa gen-route",
|
||||||
"lint": "eslint . --fix",
|
"lint": "eslint . --fix",
|
||||||
"prepare": "simple-git-hooks",
|
"prepare": "simple-git-hooks",
|
||||||
"preview": "vite preview",
|
"preview": "vite preview",
|
||||||
"release": "sa release",
|
"release": "sa release",
|
||||||
|
"tauri-icon": "pnpm tauri icon ./public/logo.png",
|
||||||
"typecheck": "vue-tsc --noEmit --skipLibCheck",
|
"typecheck": "vue-tsc --noEmit --skipLibCheck",
|
||||||
"update-pkg": "sa update-pkg"
|
"update-pkg": "sa update-pkg"
|
||||||
},
|
},
|
||||||
@@ -53,7 +56,7 @@
|
|||||||
"@sa/hooks": "workspace:*",
|
"@sa/hooks": "workspace:*",
|
||||||
"@sa/materials": "workspace:*",
|
"@sa/materials": "workspace:*",
|
||||||
"@sa/utils": "workspace:*",
|
"@sa/utils": "workspace:*",
|
||||||
"@vueuse/core": "10.9.0",
|
"@vueuse/core": "10.10.0",
|
||||||
"clipboard": "2.0.11",
|
"clipboard": "2.0.11",
|
||||||
"dayjs": "1.11.11",
|
"dayjs": "1.11.11",
|
||||||
"echarts": "5.5.0",
|
"echarts": "5.5.0",
|
||||||
@@ -61,42 +64,44 @@
|
|||||||
"naive-ui": "2.38.2",
|
"naive-ui": "2.38.2",
|
||||||
"nprogress": "0.2.0",
|
"nprogress": "0.2.0",
|
||||||
"pinia": "2.1.7",
|
"pinia": "2.1.7",
|
||||||
|
"tailwind-merge": "^2.3.0",
|
||||||
"vue": "3.4.27",
|
"vue": "3.4.27",
|
||||||
"vue-draggable-plus": "0.4.1",
|
"vue-draggable-plus": "0.5.0",
|
||||||
"vue-i18n": "9.13.1",
|
"vue-i18n": "9.13.1",
|
||||||
"vue-router": "4.3.2"
|
"vue-router": "4.3.2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@elegant-router/vue": "0.3.7",
|
"@elegant-router/vue": "0.3.7",
|
||||||
"@iconify/json": "2.2.211",
|
"@iconify/json": "2.2.217",
|
||||||
"@sa/scripts": "workspace:*",
|
"@sa/scripts": "workspace:*",
|
||||||
"@sa/uno-preset": "workspace:*",
|
"@sa/uno-preset": "workspace:*",
|
||||||
"@soybeanjs/eslint-config": "1.3.5",
|
"@soybeanjs/eslint-config": "1.3.6",
|
||||||
|
"@tauri-apps/cli": "1.5.14",
|
||||||
"@types/lodash-es": "4.17.12",
|
"@types/lodash-es": "4.17.12",
|
||||||
"@types/node": "20.12.12",
|
"@types/node": "20.14.2",
|
||||||
"@types/nprogress": "0.2.3",
|
"@types/nprogress": "0.2.3",
|
||||||
"@unocss/eslint-config": "0.60.2",
|
"@unocss/eslint-config": "0.60.4",
|
||||||
"@unocss/preset-icons": "0.60.2",
|
"@unocss/preset-icons": "0.60.4",
|
||||||
"@unocss/preset-uno": "0.60.2",
|
"@unocss/preset-uno": "0.60.4",
|
||||||
"@unocss/transformer-directives": "0.60.2",
|
"@unocss/transformer-directives": "0.60.4",
|
||||||
"@unocss/transformer-variant-group": "0.60.2",
|
"@unocss/transformer-variant-group": "0.60.4",
|
||||||
"@unocss/vite": "0.60.2",
|
"@unocss/vite": "0.60.4",
|
||||||
"@vitejs/plugin-vue": "5.0.4",
|
"@vitejs/plugin-vue": "5.0.5",
|
||||||
"@vitejs/plugin-vue-jsx": "3.1.0",
|
"@vitejs/plugin-vue-jsx": "4.0.0",
|
||||||
"eslint": "9.3.0",
|
"eslint": "9.4.0",
|
||||||
"eslint-plugin-vue": "9.26.0",
|
"eslint-plugin-vue": "9.26.0",
|
||||||
"lint-staged": "15.2.2",
|
"lint-staged": "15.2.5",
|
||||||
"sass": "1.77.2",
|
"sass": "1.77.4",
|
||||||
"simple-git-hooks": "2.11.1",
|
"simple-git-hooks": "2.11.1",
|
||||||
"tsx": "4.10.5",
|
"tsx": "4.12.0",
|
||||||
"typescript": "5.4.5",
|
"typescript": "5.4.5",
|
||||||
"unplugin-icons": "0.19.0",
|
"unplugin-icons": "0.19.0",
|
||||||
"unplugin-vue-components": "0.27.0",
|
"unplugin-vue-components": "0.27.0",
|
||||||
"vite": "5.2.11",
|
"vite": "5.2.12",
|
||||||
"vite-plugin-progress": "0.0.7",
|
"vite-plugin-progress": "0.0.7",
|
||||||
"vite-plugin-svg-icons": "2.0.1",
|
"vite-plugin-svg-icons": "2.0.1",
|
||||||
"vite-plugin-vue-devtools": "7.2.0",
|
"vite-plugin-vue-devtools": "7.2.1",
|
||||||
"vue-eslint-parser": "9.4.2",
|
"vue-eslint-parser": "9.4.3",
|
||||||
"vue-tsc": "2.0.19"
|
"vue-tsc": "2.0.19"
|
||||||
},
|
},
|
||||||
"simple-git-hooks": {
|
"simple-git-hooks": {
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@sa/axios",
|
"name": "@sa/axios",
|
||||||
"version": "1.1.1",
|
"version": "1.2.1",
|
||||||
"exports": {
|
"exports": {
|
||||||
".": "./src/index.ts"
|
".": "./src/index.ts"
|
||||||
},
|
},
|
||||||
@@ -11,8 +11,8 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@sa/utils": "workspace:*",
|
"@sa/utils": "workspace:*",
|
||||||
"axios": "1.6.8",
|
"axios": "1.7.2",
|
||||||
"axios-retry": "4.2.0",
|
"axios-retry": "4.4.0",
|
||||||
"qs": "6.12.1"
|
"qs": "6.12.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@sa/color",
|
"name": "@sa/color",
|
||||||
"version": "1.1.1",
|
"version": "1.2.1",
|
||||||
"exports": {
|
"exports": {
|
||||||
".": "./src/index.ts"
|
".": "./src/index.ts"
|
||||||
},
|
},
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@sa/hooks",
|
"name": "@sa/hooks",
|
||||||
"version": "1.1.1",
|
"version": "1.2.1",
|
||||||
"exports": {
|
"exports": {
|
||||||
".": "./src/index.ts"
|
".": "./src/index.ts"
|
||||||
},
|
},
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@sa/materials",
|
"name": "@sa/materials",
|
||||||
"version": "1.1.1",
|
"version": "1.2.1",
|
||||||
"exports": {
|
"exports": {
|
||||||
".": "./src/index.ts"
|
".": "./src/index.ts"
|
||||||
},
|
},
|
||||||
|
@@ -36,7 +36,7 @@ defineSlots<Slots>();
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div
|
<div
|
||||||
class=":soy: relative inline-flex cursor-pointer items-center justify-center gap-12px whitespace-nowrap border-1px rounded-4px border-solid px-12px py-4px"
|
class=":soy: relative inline-flex cursor-pointer items-center justify-center gap-12px whitespace-nowrap border-(1px solid) rounded-4px px-12px py-4px"
|
||||||
:class="[
|
:class="[
|
||||||
style['button-tab'],
|
style['button-tab'],
|
||||||
{ [style['button-tab_dark']]: darkMode },
|
{ [style['button-tab_dark']]: darkMode },
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@sa/fetch",
|
"name": "@sa/fetch",
|
||||||
"version": "1.1.1",
|
"version": "1.2.1",
|
||||||
"exports": {
|
"exports": {
|
||||||
".": "./src/index.ts"
|
".": "./src/index.ts"
|
||||||
},
|
},
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@sa/scripts",
|
"name": "@sa/scripts",
|
||||||
"version": "1.1.1",
|
"version": "1.2.1",
|
||||||
"bin": {
|
"bin": {
|
||||||
"sa": "./bin.ts"
|
"sa": "./bin.ts"
|
||||||
},
|
},
|
||||||
@@ -13,13 +13,13 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@soybeanjs/changelog": "0.3.23",
|
"@soybeanjs/changelog": "0.3.24",
|
||||||
"bumpp": "9.4.1",
|
"bumpp": "9.4.1",
|
||||||
"c12": "1.10.0",
|
"c12": "1.10.0",
|
||||||
"cac": "6.7.14",
|
"cac": "6.7.14",
|
||||||
"consola": "3.2.3",
|
"consola": "3.2.3",
|
||||||
"enquirer": "2.4.1",
|
"enquirer": "2.4.1",
|
||||||
"execa": "9.1.0",
|
"execa": "9.2.0",
|
||||||
"kolorist": "1.8.0",
|
"kolorist": "1.8.0",
|
||||||
"npm-check-updates": "16.14.20",
|
"npm-check-updates": "16.14.20",
|
||||||
"rimraf": "5.0.7"
|
"rimraf": "5.0.7"
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@sa/uno-preset",
|
"name": "@sa/uno-preset",
|
||||||
"version": "1.1.1",
|
"version": "1.2.1",
|
||||||
"exports": {
|
"exports": {
|
||||||
".": "./src/index.ts"
|
".": "./src/index.ts"
|
||||||
},
|
},
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@sa/utils",
|
"name": "@sa/utils",
|
||||||
"version": "1.1.1",
|
"version": "1.2.1",
|
||||||
"exports": {
|
"exports": {
|
||||||
".": "./src/index.ts"
|
".": "./src/index.ts"
|
||||||
},
|
},
|
||||||
|
2211
pnpm-lock.yaml
generated
BIN
public/logo.png
Normal file
After Width: | Height: | Size: 20 KiB |
3
src-tauri/.gitignore
vendored
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
# Generated by Cargo
|
||||||
|
# will have compiled files and executables
|
||||||
|
/target/
|
3664
src-tauri/Cargo.lock
generated
Normal file
26
src-tauri/Cargo.toml
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
[package]
|
||||||
|
name = "app"
|
||||||
|
version = "0.1.0"
|
||||||
|
description = "A Tauri App"
|
||||||
|
authors = ["you"]
|
||||||
|
license = ""
|
||||||
|
repository = ""
|
||||||
|
default-run = "app"
|
||||||
|
edition = "2021"
|
||||||
|
rust-version = "1.60"
|
||||||
|
|
||||||
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
||||||
|
[build-dependencies]
|
||||||
|
tauri-build = { version = "1.5.1", features = [] }
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
|
serde_json = "1.0"
|
||||||
|
serde = { version = "1.0", features = ["derive"] }
|
||||||
|
tauri = { version = "1.6.1", features = [] }
|
||||||
|
|
||||||
|
[features]
|
||||||
|
# this feature is used for production builds or when `devPath` points to the filesystem and the built-in dev server is disabled.
|
||||||
|
# If you use cargo directly instead of tauri's cli you can use this feature flag to switch between tauri's `dev` and `build` modes.
|
||||||
|
# DO NOT REMOVE!!
|
||||||
|
custom-protocol = [ "tauri/custom-protocol" ]
|
3
src-tauri/build.rs
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
fn main() {
|
||||||
|
tauri_build::build()
|
||||||
|
}
|
BIN
src-tauri/icons/128x128.png
Normal file
After Width: | Height: | Size: 8.8 KiB |
BIN
src-tauri/icons/128x128@2x.png
Normal file
After Width: | Height: | Size: 19 KiB |
BIN
src-tauri/icons/32x32.png
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
src-tauri/icons/Square107x107Logo.png
Normal file
After Width: | Height: | Size: 7.4 KiB |
BIN
src-tauri/icons/Square142x142Logo.png
Normal file
After Width: | Height: | Size: 9.9 KiB |
BIN
src-tauri/icons/Square150x150Logo.png
Normal file
After Width: | Height: | Size: 10 KiB |
BIN
src-tauri/icons/Square284x284Logo.png
Normal file
After Width: | Height: | Size: 21 KiB |
BIN
src-tauri/icons/Square30x30Logo.png
Normal file
After Width: | Height: | Size: 1.6 KiB |
BIN
src-tauri/icons/Square310x310Logo.png
Normal file
After Width: | Height: | Size: 23 KiB |
BIN
src-tauri/icons/Square44x44Logo.png
Normal file
After Width: | Height: | Size: 2.6 KiB |
BIN
src-tauri/icons/Square71x71Logo.png
Normal file
After Width: | Height: | Size: 4.7 KiB |
BIN
src-tauri/icons/Square89x89Logo.png
Normal file
After Width: | Height: | Size: 6.1 KiB |
BIN
src-tauri/icons/StoreLogo.png
Normal file
After Width: | Height: | Size: 3.0 KiB |
BIN
src-tauri/icons/icon.icns
Normal file
BIN
src-tauri/icons/icon.ico
Normal file
After Width: | Height: | Size: 31 KiB |
BIN
src-tauri/icons/icon.png
Normal file
After Width: | Height: | Size: 39 KiB |
8
src-tauri/src/main.rs
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
// Prevents additional console window on Windows in release, DO NOT REMOVE!!
|
||||||
|
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
tauri::Builder::default()
|
||||||
|
.run(tauri::generate_context!())
|
||||||
|
.expect("error while running tauri application");
|
||||||
|
}
|
60
src-tauri/tauri.conf.json
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
{
|
||||||
|
"$schema": "../node_modules/@tauri-apps/cli/schema.json",
|
||||||
|
"build": {
|
||||||
|
"beforeBuildCommand": "npm run build",
|
||||||
|
"beforeDevCommand": "npm run dev",
|
||||||
|
"devPath": "http://localhost:9527",
|
||||||
|
"distDir": "../dist"
|
||||||
|
},
|
||||||
|
"package": {
|
||||||
|
"productName": "soybean-admin",
|
||||||
|
"version": "1.0.0"
|
||||||
|
},
|
||||||
|
"tauri": {
|
||||||
|
"allowlist": {
|
||||||
|
"all": false
|
||||||
|
},
|
||||||
|
"bundle": {
|
||||||
|
"active": true,
|
||||||
|
"category": "DeveloperTool",
|
||||||
|
"copyright": "",
|
||||||
|
"deb": {
|
||||||
|
"depends": []
|
||||||
|
},
|
||||||
|
"externalBin": [],
|
||||||
|
"icon": ["icons/32x32.png", "icons/128x128.png", "icons/128x128@2x.png", "icons/icon.icns", "icons/icon.ico"],
|
||||||
|
"identifier": "cn.soybeanjs.admin",
|
||||||
|
"longDescription": "",
|
||||||
|
"macOS": {
|
||||||
|
"entitlements": null,
|
||||||
|
"exceptionDomain": "",
|
||||||
|
"frameworks": [],
|
||||||
|
"providerShortName": null,
|
||||||
|
"signingIdentity": null
|
||||||
|
},
|
||||||
|
"resources": [],
|
||||||
|
"shortDescription": "",
|
||||||
|
"targets": "all",
|
||||||
|
"windows": {
|
||||||
|
"certificateThumbprint": null,
|
||||||
|
"digestAlgorithm": "sha256",
|
||||||
|
"timestampUrl": ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"security": {
|
||||||
|
"csp": null
|
||||||
|
},
|
||||||
|
"updater": {
|
||||||
|
"active": false
|
||||||
|
},
|
||||||
|
"windows": [
|
||||||
|
{
|
||||||
|
"fullscreen": false,
|
||||||
|
"height": 768,
|
||||||
|
"resizable": true,
|
||||||
|
"title": "SoybeanAdmin",
|
||||||
|
"width": 1366
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
@@ -21,10 +21,10 @@ const columns = defineModel<NaiveUI.TableColumnCheck[]>('columns', {
|
|||||||
{{ $t('common.columnSetting') }}
|
{{ $t('common.columnSetting') }}
|
||||||
</NButton>
|
</NButton>
|
||||||
</template>
|
</template>
|
||||||
<VueDraggable v-model="columns">
|
<VueDraggable v-model="columns" :animation="150" filter=".none_draggable">
|
||||||
<div v-for="item in columns" :key="item.key" class="h-36px flex-y-center rd-4px hover:(bg-primary bg-opacity-20)">
|
<div v-for="item in columns" :key="item.key" class="h-36px flex-y-center rd-4px hover:(bg-primary bg-opacity-20)">
|
||||||
<icon-mdi-drag class="mr-8px cursor-move text-icon" />
|
<icon-mdi-drag class="mr-8px h-full cursor-move text-icon" />
|
||||||
<NCheckbox v-model:checked="item.checked">
|
<NCheckbox v-model:checked="item.checked" class="none_draggable flex-1">
|
||||||
{{ item.title }}
|
{{ item.title }}
|
||||||
</NCheckbox>
|
</NCheckbox>
|
||||||
</div>
|
</div>
|
||||||
|
@@ -1,7 +1,6 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { computed } from 'vue';
|
|
||||||
import { createReusableTemplate } from '@vueuse/core';
|
|
||||||
import type { PopoverPlacement } from 'naive-ui';
|
import type { PopoverPlacement } from 'naive-ui';
|
||||||
|
import { twMerge } from 'tailwind-merge';
|
||||||
|
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: 'ButtonIcon',
|
name: 'ButtonIcon',
|
||||||
@@ -21,60 +20,29 @@ interface Props {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const props = withDefaults(defineProps<Props>(), {
|
const props = withDefaults(defineProps<Props>(), {
|
||||||
class: 'h-36px text-icon',
|
class: '',
|
||||||
icon: '',
|
icon: '',
|
||||||
tooltipContent: '',
|
tooltipContent: '',
|
||||||
tooltipPlacement: 'bottom',
|
tooltipPlacement: 'bottom',
|
||||||
zIndex: 98
|
zIndex: 98
|
||||||
});
|
});
|
||||||
|
|
||||||
interface ButtonProps {
|
const DEFAULT_CLASS = 'h-[36px] text-icon';
|
||||||
className: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
const [DefineButton, Button] = createReusableTemplate<ButtonProps>();
|
|
||||||
|
|
||||||
const cls = computed(() => {
|
|
||||||
let clsStr = props.class;
|
|
||||||
|
|
||||||
if (!clsStr.includes('h-')) {
|
|
||||||
clsStr += ' h-36px';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!clsStr.includes('text-')) {
|
|
||||||
clsStr += ' text-icon';
|
|
||||||
}
|
|
||||||
|
|
||||||
return clsStr;
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<!-- define component start: Button -->
|
<NTooltip :placement="tooltipPlacement" :z-index="zIndex" :disabled="!tooltipContent">
|
||||||
<DefineButton v-slot="{ $slots, className }">
|
|
||||||
<NButton quaternary :class="className">
|
|
||||||
<div class="flex-center gap-8px">
|
|
||||||
<component :is="$slots.default" />
|
|
||||||
</div>
|
|
||||||
</NButton>
|
|
||||||
</DefineButton>
|
|
||||||
<!-- define component end: Button -->
|
|
||||||
|
|
||||||
<NTooltip v-if="tooltipContent" :placement="tooltipPlacement" :z-index="zIndex">
|
|
||||||
<template #trigger>
|
<template #trigger>
|
||||||
<Button :class-name="cls" v-bind="$attrs">
|
<NButton quaternary :class="twMerge(DEFAULT_CLASS, props.class)" v-bind="$attrs">
|
||||||
|
<div class="flex-center gap-8px">
|
||||||
<slot>
|
<slot>
|
||||||
<SvgIcon :icon="icon" />
|
<SvgIcon :icon="icon" />
|
||||||
</slot>
|
</slot>
|
||||||
</Button>
|
</div>
|
||||||
|
</NButton>
|
||||||
</template>
|
</template>
|
||||||
{{ tooltipContent }}
|
{{ tooltipContent }}
|
||||||
</NTooltip>
|
</NTooltip>
|
||||||
<Button v-else :class-name="cls" v-bind="$attrs">
|
|
||||||
<slot>
|
|
||||||
<SvgIcon :icon="icon" />
|
|
||||||
</slot>
|
|
||||||
</Button>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped></style>
|
<style scoped></style>
|
||||||
|
@@ -3,6 +3,7 @@ import { computed } from 'vue';
|
|||||||
import { useAppStore } from '@/store/modules/app';
|
import { useAppStore } from '@/store/modules/app';
|
||||||
import { useThemeStore } from '@/store/modules/theme';
|
import { useThemeStore } from '@/store/modules/theme';
|
||||||
import { useRouteStore } from '@/store/modules/route';
|
import { useRouteStore } from '@/store/modules/route';
|
||||||
|
import { useTabStore } from '@/store/modules/tab';
|
||||||
|
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: 'GlobalContent'
|
name: 'GlobalContent'
|
||||||
@@ -20,6 +21,7 @@ withDefaults(defineProps<Props>(), {
|
|||||||
const appStore = useAppStore();
|
const appStore = useAppStore();
|
||||||
const themeStore = useThemeStore();
|
const themeStore = useThemeStore();
|
||||||
const routeStore = useRouteStore();
|
const routeStore = useRouteStore();
|
||||||
|
const tabStore = useTabStore();
|
||||||
|
|
||||||
const transitionName = computed(() => (themeStore.page.animate ? themeStore.page.animateMode : ''));
|
const transitionName = computed(() => (themeStore.page.animate ? themeStore.page.animateMode : ''));
|
||||||
</script>
|
</script>
|
||||||
@@ -36,7 +38,7 @@ const transitionName = computed(() => (themeStore.page.animate ? themeStore.page
|
|||||||
<component
|
<component
|
||||||
:is="Component"
|
:is="Component"
|
||||||
v-if="appStore.reloadFlag"
|
v-if="appStore.reloadFlag"
|
||||||
:key="route.path"
|
:key="tabStore.getTabIdByRoute(route)"
|
||||||
:class="{ 'p-16px': showPadding }"
|
:class="{ 'p-16px': showPadding }"
|
||||||
class="flex-grow bg-layout transition-300"
|
class="flex-grow bg-layout transition-300"
|
||||||
/>
|
/>
|
||||||
|
@@ -47,7 +47,7 @@ const headerMenus = computed(() => {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<DarkModeContainer class="h-full flex-y-center shadow-header">
|
<DarkModeContainer class="h-full flex-y-center px-12px shadow-header">
|
||||||
<GlobalLogo v-if="showLogo" class="h-full" :style="{ width: themeStore.sider.width + 'px' }" />
|
<GlobalLogo v-if="showLogo" class="h-full" :style="{ width: themeStore.sider.width + 'px' }" />
|
||||||
<HorizontalMenu v-if="showMenu" mode="horizontal" :menus="headerMenus" class="px-12px" />
|
<HorizontalMenu v-if="showMenu" mode="horizontal" :menus="headerMenus" class="px-12px" />
|
||||||
<div v-else class="h-full flex-y-center flex-1-hidden">
|
<div v-else class="h-full flex-y-center flex-1-hidden">
|
||||||
|
@@ -68,7 +68,7 @@ function handleClickMixMenu(menu: App.Global.Menu) {
|
|||||||
<component :is="icon" :class="[isMini ? 'text-icon-small' : 'text-icon-large']" />
|
<component :is="icon" :class="[isMini ? 'text-icon-small' : 'text-icon-large']" />
|
||||||
<p
|
<p
|
||||||
class="w-full ellipsis-text text-center text-12px transition-height-300"
|
class="w-full ellipsis-text text-center text-12px transition-height-300"
|
||||||
:class="[isMini ? 'h-0 pt-0' : 'h-24px pt-4px']"
|
:class="[isMini ? 'h-0 pt-0' : 'h-20px pt-4px']"
|
||||||
>
|
>
|
||||||
{{ label }}
|
{{ label }}
|
||||||
</p>
|
</p>
|
||||||
|
@@ -55,8 +55,8 @@ function handleResetActiveMenu() {
|
|||||||
:inverted="siderInverted"
|
:inverted="siderInverted"
|
||||||
:style="{ width: showDrawer ? themeStore.sider.mixChildMenuWidth + 'px' : '0px' }"
|
:style="{ width: showDrawer ? themeStore.sider.mixChildMenuWidth + 'px' : '0px' }"
|
||||||
>
|
>
|
||||||
<header class="flex-y-center justify-between" :style="{ height: themeStore.header.height + 'px' }">
|
<header class="flex-y-center justify-between px-12px" :style="{ height: themeStore.header.height + 'px' }">
|
||||||
<h2 class="pl-8px text-16px text-primary font-bold">{{ $t('system.title') }}</h2>
|
<h2 class="text-16px text-primary font-bold">{{ $t('system.title') }}</h2>
|
||||||
<PinToggler
|
<PinToggler
|
||||||
:pin="appStore.mixSiderFixed"
|
:pin="appStore.mixSiderFixed"
|
||||||
:class="{ 'text-white:88 !hover:text-white': siderInverted }"
|
:class="{ 'text-white:88 !hover:text-white': siderInverted }"
|
||||||
|
@@ -34,9 +34,9 @@ function search() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function handleClose() {
|
function handleClose() {
|
||||||
visible.value = false;
|
|
||||||
// handle with setTimeout to prevent user from seeing some operations
|
// handle with setTimeout to prevent user from seeing some operations
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
visible.value = false;
|
||||||
resultOptions.value = [];
|
resultOptions.value = [];
|
||||||
keyword.value = '';
|
keyword.value = '';
|
||||||
}, 200);
|
}, 200);
|
||||||
@@ -112,7 +112,7 @@ registerShortcut();
|
|||||||
|
|
||||||
<div class="mt-20px">
|
<div class="mt-20px">
|
||||||
<NEmpty v-if="resultOptions.length === 0" :description="$t('common.noData')" />
|
<NEmpty v-if="resultOptions.length === 0" :description="$t('common.noData')" />
|
||||||
<SearchResult v-else v-model:path="activePath" :options="resultOptions" @enter.prevent="handleEnter" />
|
<SearchResult v-else v-model:path="activePath" :options="resultOptions" @enter="handleEnter" />
|
||||||
</div>
|
</div>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<SearchFooter v-if="!isMobile" />
|
<SearchFooter v-if="!isMobile" />
|
||||||
|
@@ -141,6 +141,10 @@ function init() {
|
|||||||
tabStore.initTabStore(route);
|
tabStore.initTabStore(route);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function removeFocus() {
|
||||||
|
(document.activeElement as HTMLElement)?.blur();
|
||||||
|
}
|
||||||
|
|
||||||
// watch
|
// watch
|
||||||
watch(
|
watch(
|
||||||
() => route.fullPath,
|
() => route.fullPath,
|
||||||
@@ -162,7 +166,11 @@ init();
|
|||||||
<template>
|
<template>
|
||||||
<DarkModeContainer class="size-full flex-y-center px-16px shadow-tab">
|
<DarkModeContainer class="size-full flex-y-center px-16px shadow-tab">
|
||||||
<div ref="bsWrapper" class="h-full flex-1-hidden">
|
<div ref="bsWrapper" class="h-full flex-1-hidden">
|
||||||
<BetterScroll ref="bsScroll" :options="{ scrollX: true, scrollY: false, click: appStore.isMobile }">
|
<BetterScroll
|
||||||
|
ref="bsScroll"
|
||||||
|
:options="{ scrollX: true, scrollY: false, click: appStore.isMobile }"
|
||||||
|
@click="removeFocus"
|
||||||
|
>
|
||||||
<div
|
<div
|
||||||
ref="tabRef"
|
ref="tabRef"
|
||||||
class="h-full flex pr-18px"
|
class="h-full flex pr-18px"
|
||||||
|
@@ -1,6 +1,10 @@
|
|||||||
const local: App.I18n.Schema = {
|
const local: App.I18n.Schema = {
|
||||||
system: {
|
system: {
|
||||||
title: 'SoybeanAdmin'
|
title: 'SoybeanAdmin',
|
||||||
|
updateTitle: 'System Version Update Notification',
|
||||||
|
updateContent: 'A new version of the system has been detected. Do you want to refresh the page immediately?',
|
||||||
|
updateConfirm: 'Refresh immediately',
|
||||||
|
updateCancel: 'Later'
|
||||||
},
|
},
|
||||||
common: {
|
common: {
|
||||||
action: 'Action',
|
action: 'Action',
|
||||||
|
@@ -1,6 +1,10 @@
|
|||||||
const local: App.I18n.Schema = {
|
const local: App.I18n.Schema = {
|
||||||
system: {
|
system: {
|
||||||
title: 'Soybean 管理系统'
|
title: 'Soybean 管理系统',
|
||||||
|
updateTitle: '系统版本更新通知',
|
||||||
|
updateContent: '检测到系统有新版本发布,是否立即刷新页面?',
|
||||||
|
updateConfirm: '立即刷新',
|
||||||
|
updateCancel: '稍后再说'
|
||||||
},
|
},
|
||||||
common: {
|
common: {
|
||||||
action: '操作',
|
action: '操作',
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
import { createApp } from 'vue';
|
import { createApp } from 'vue';
|
||||||
import './plugins/assets';
|
import './plugins/assets';
|
||||||
import { setupDayjs, setupIconifyOffline, setupLoading, setupNProgress } from './plugins';
|
import { setupAppVersionNotification, setupDayjs, setupIconifyOffline, setupLoading, setupNProgress } from './plugins';
|
||||||
import { setupStore } from './store';
|
import { setupStore } from './store';
|
||||||
import { setupRouter } from './router';
|
import { setupRouter } from './router';
|
||||||
import { setupI18n } from './locales';
|
import { setupI18n } from './locales';
|
||||||
@@ -23,6 +23,8 @@ async function setupApp() {
|
|||||||
|
|
||||||
setupI18n(app);
|
setupI18n(app);
|
||||||
|
|
||||||
|
setupAppVersionNotification();
|
||||||
|
|
||||||
app.mount('#app');
|
app.mount('#app');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
53
src/plugins/app.ts
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
import { h } from 'vue';
|
||||||
|
import { NButton } from 'naive-ui';
|
||||||
|
import { $t } from '../locales';
|
||||||
|
|
||||||
|
export function setupAppVersionNotification() {
|
||||||
|
document.addEventListener('visibilitychange', async () => {
|
||||||
|
const buildTime = await getHtmlBuildTime();
|
||||||
|
|
||||||
|
if (buildTime !== BUILD_TIME && document.visibilityState === 'visible') {
|
||||||
|
const n = window.$notification?.create({
|
||||||
|
title: $t('system.updateTitle'),
|
||||||
|
content: $t('system.updateContent'),
|
||||||
|
action() {
|
||||||
|
return h('div', { style: { display: 'flex', justifyContent: 'end', gap: '12px', width: '325px' } }, [
|
||||||
|
h(
|
||||||
|
NButton,
|
||||||
|
{
|
||||||
|
onClick() {
|
||||||
|
n?.destroy();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
() => $t('system.updateCancel')
|
||||||
|
),
|
||||||
|
h(
|
||||||
|
NButton,
|
||||||
|
{
|
||||||
|
type: 'primary',
|
||||||
|
onClick() {
|
||||||
|
location.reload();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
() => $t('system.updateConfirm')
|
||||||
|
)
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
async function getHtmlBuildTime() {
|
||||||
|
const baseURL = import.meta.env.VITE_BASE_URL;
|
||||||
|
|
||||||
|
const res = await fetch(`${baseURL}index.html`);
|
||||||
|
|
||||||
|
const html = await res.text();
|
||||||
|
|
||||||
|
const match = html.match(/<meta name="buildTime" content="(.*)">/);
|
||||||
|
|
||||||
|
const buildTime = match?.[1] || '';
|
||||||
|
|
||||||
|
return buildTime;
|
||||||
|
}
|
@@ -2,3 +2,4 @@ export * from './loading';
|
|||||||
export * from './nprogress';
|
export * from './nprogress';
|
||||||
export * from './iconify';
|
export * from './iconify';
|
||||||
export * from './dayjs';
|
export * from './dayjs';
|
||||||
|
export * from './app';
|
||||||
|
@@ -46,7 +46,7 @@ export function createRouteGuard(router: Router) {
|
|||||||
next({ name: rootRoute });
|
next({ name: rootRoute });
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// if is is constant route, then it is allowed to access directly
|
// if it is constant route, then it is allowed to access directly
|
||||||
{
|
{
|
||||||
condition: !needLogin,
|
condition: !needLogin,
|
||||||
callback: () => {
|
callback: () => {
|
||||||
@@ -92,6 +92,7 @@ export function createRouteGuard(router: Router) {
|
|||||||
* @param to to route
|
* @param to to route
|
||||||
*/
|
*/
|
||||||
async function initRoute(to: RouteLocationNormalized): Promise<RouteLocationRaw | null> {
|
async function initRoute(to: RouteLocationNormalized): Promise<RouteLocationRaw | null> {
|
||||||
|
const authStore = useAuthStore();
|
||||||
const routeStore = useRouteStore();
|
const routeStore = useRouteStore();
|
||||||
|
|
||||||
const notFoundRoute: RouteKey = 'not-found';
|
const notFoundRoute: RouteKey = 'not-found';
|
||||||
@@ -160,6 +161,8 @@ async function initRoute(to: RouteLocationNormalized): Promise<RouteLocationRaw
|
|||||||
return location;
|
return location;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
await authStore.initUserInfo();
|
||||||
|
|
||||||
// initialize the auth route
|
// initialize the auth route
|
||||||
await routeStore.initAuthRoute();
|
await routeStore.initAuthRoute();
|
||||||
|
|
||||||
|
@@ -64,9 +64,10 @@ export const request = createFlatRequest<App.Service.Response, RequestInstanceSt
|
|||||||
|
|
||||||
window.$dialog?.error({
|
window.$dialog?.error({
|
||||||
title: 'Error',
|
title: 'Error',
|
||||||
content: response.data.code,
|
content: response.data.msg,
|
||||||
positiveText: $t('common.confirm'),
|
positiveText: $t('common.confirm'),
|
||||||
maskClosable: false,
|
maskClosable: false,
|
||||||
|
closeOnEsc: false,
|
||||||
onPositiveClick() {
|
onPositiveClick() {
|
||||||
logoutAndCleanup();
|
logoutAndCleanup();
|
||||||
},
|
},
|
||||||
|
@@ -123,7 +123,7 @@ export const useAppStore = defineStore(SetupStoreId.App, () => {
|
|||||||
// update tabs by locale
|
// update tabs by locale
|
||||||
tabStore.updateTabsByLocale();
|
tabStore.updateTabsByLocale();
|
||||||
|
|
||||||
// sey dayjs locale
|
// set dayjs locale
|
||||||
setDayjsLocale(locale.value);
|
setDayjsLocale(locale.value);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@@ -8,7 +8,7 @@ import { fetchGetUserInfo, fetchLogin } from '@/service/api';
|
|||||||
import { localStg } from '@/utils/storage';
|
import { localStg } from '@/utils/storage';
|
||||||
import { $t } from '@/locales';
|
import { $t } from '@/locales';
|
||||||
import { useRouteStore } from '../route';
|
import { useRouteStore } from '../route';
|
||||||
import { clearAuthStorage, getToken, getUserInfo } from './shared';
|
import { clearAuthStorage, getToken } from './shared';
|
||||||
|
|
||||||
export const useAuthStore = defineStore(SetupStoreId.Auth, () => {
|
export const useAuthStore = defineStore(SetupStoreId.Auth, () => {
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
@@ -18,7 +18,12 @@ export const useAuthStore = defineStore(SetupStoreId.Auth, () => {
|
|||||||
|
|
||||||
const token = ref(getToken());
|
const token = ref(getToken());
|
||||||
|
|
||||||
const userInfo: Api.Auth.UserInfo = reactive(getUserInfo());
|
const userInfo: Api.Auth.UserInfo = reactive({
|
||||||
|
userId: '',
|
||||||
|
userName: '',
|
||||||
|
roles: [],
|
||||||
|
buttons: []
|
||||||
|
});
|
||||||
|
|
||||||
/** is super role in static route */
|
/** is super role in static route */
|
||||||
const isStaticSuper = computed(() => {
|
const isStaticSuper = computed(() => {
|
||||||
@@ -87,14 +92,23 @@ export const useAuthStore = defineStore(SetupStoreId.Auth, () => {
|
|||||||
localStg.set('token', loginToken.token);
|
localStg.set('token', loginToken.token);
|
||||||
localStg.set('refreshToken', loginToken.refreshToken);
|
localStg.set('refreshToken', loginToken.refreshToken);
|
||||||
|
|
||||||
|
// 2. get user info
|
||||||
|
const pass = await getUserInfo();
|
||||||
|
|
||||||
|
if (pass) {
|
||||||
|
token.value = loginToken.token;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
async function getUserInfo() {
|
||||||
const { data: info, error } = await fetchGetUserInfo();
|
const { data: info, error } = await fetchGetUserInfo();
|
||||||
|
|
||||||
if (!error) {
|
if (!error) {
|
||||||
// 2. store user info
|
// update store
|
||||||
localStg.set('userInfo', info);
|
|
||||||
|
|
||||||
// 3. update store
|
|
||||||
token.value = loginToken.token;
|
|
||||||
Object.assign(userInfo, info);
|
Object.assign(userInfo, info);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@@ -103,6 +117,18 @@ export const useAuthStore = defineStore(SetupStoreId.Auth, () => {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function initUserInfo() {
|
||||||
|
const hasToken = getToken();
|
||||||
|
|
||||||
|
if (hasToken) {
|
||||||
|
const pass = await getUserInfo();
|
||||||
|
|
||||||
|
if (!pass) {
|
||||||
|
resetStore();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
token,
|
token,
|
||||||
userInfo,
|
userInfo,
|
||||||
@@ -110,6 +136,7 @@ export const useAuthStore = defineStore(SetupStoreId.Auth, () => {
|
|||||||
isLogin,
|
isLogin,
|
||||||
loginLoading,
|
loginLoading,
|
||||||
resetStore,
|
resetStore,
|
||||||
login
|
login,
|
||||||
|
initUserInfo
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
@@ -5,27 +5,8 @@ export function getToken() {
|
|||||||
return localStg.get('token') || '';
|
return localStg.get('token') || '';
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Get user info */
|
|
||||||
export function getUserInfo() {
|
|
||||||
const emptyInfo: Api.Auth.UserInfo = {
|
|
||||||
userId: '',
|
|
||||||
userName: '',
|
|
||||||
roles: [],
|
|
||||||
buttons: []
|
|
||||||
};
|
|
||||||
const userInfo = localStg.get('userInfo') || emptyInfo;
|
|
||||||
|
|
||||||
// fix new property: buttons, this will be removed in the next version `1.1.0`
|
|
||||||
if (!userInfo.buttons) {
|
|
||||||
userInfo.buttons = [];
|
|
||||||
}
|
|
||||||
|
|
||||||
return userInfo;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Clear auth storage */
|
/** Clear auth storage */
|
||||||
export function clearAuthStorage() {
|
export function clearAuthStorage() {
|
||||||
localStg.remove('token');
|
localStg.remove('token');
|
||||||
localStg.remove('refreshToken');
|
localStg.remove('refreshToken');
|
||||||
localStg.remove('userInfo');
|
|
||||||
}
|
}
|
||||||
|
@@ -97,13 +97,19 @@ export const useRouteStore = defineStore(SetupStoreId.Route, () => {
|
|||||||
/** Cache routes */
|
/** Cache routes */
|
||||||
const cacheRoutes = ref<RouteKey[]>([]);
|
const cacheRoutes = ref<RouteKey[]>([]);
|
||||||
|
|
||||||
|
/** All cache routes */
|
||||||
|
const allCacheRoutes = shallowRef<RouteKey[]>([]);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get cache routes
|
* Get cache routes
|
||||||
*
|
*
|
||||||
* @param routes Vue routes
|
* @param routes Vue routes
|
||||||
*/
|
*/
|
||||||
function getCacheRoutes(routes: RouteRecordRaw[]) {
|
function getCacheRoutes(routes: RouteRecordRaw[]) {
|
||||||
cacheRoutes.value = getCacheRouteNames(routes);
|
const alls = getCacheRouteNames(routes);
|
||||||
|
|
||||||
|
cacheRoutes.value = alls;
|
||||||
|
allCacheRoutes.value = [...alls];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -130,12 +136,23 @@ export const useRouteStore = defineStore(SetupStoreId.Route, () => {
|
|||||||
cacheRoutes.value.splice(index, 1);
|
cacheRoutes.value.splice(index, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Is cached route
|
||||||
|
*
|
||||||
|
* @param routeKey
|
||||||
|
*/
|
||||||
|
function isCachedRoute(routeKey: RouteKey) {
|
||||||
|
return allCacheRoutes.value.includes(routeKey);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Re cache routes by route key
|
* Re cache routes by route key
|
||||||
*
|
*
|
||||||
* @param routeKey
|
* @param routeKey
|
||||||
*/
|
*/
|
||||||
async function reCacheRoutesByKey(routeKey: RouteKey) {
|
async function reCacheRoutesByKey(routeKey: RouteKey) {
|
||||||
|
if (!isCachedRoute(routeKey)) return;
|
||||||
|
|
||||||
removeCacheRoutes(routeKey);
|
removeCacheRoutes(routeKey);
|
||||||
|
|
||||||
await appStore.reloadPage();
|
await appStore.reloadPage();
|
||||||
|
@@ -17,6 +17,7 @@ import {
|
|||||||
getDefaultHomeTab,
|
getDefaultHomeTab,
|
||||||
getFixedTabIds,
|
getFixedTabIds,
|
||||||
getTabByRoute,
|
getTabByRoute,
|
||||||
|
getTabIdByRoute,
|
||||||
isTabInTabs,
|
isTabInTabs,
|
||||||
updateTabByI18nKey,
|
updateTabByI18nKey,
|
||||||
updateTabsByI18nKey
|
updateTabsByI18nKey
|
||||||
@@ -288,6 +289,7 @@ export const useTabStore = defineStore(SetupStoreId.Tab, () => {
|
|||||||
setTabLabel,
|
setTabLabel,
|
||||||
resetTabLabel,
|
resetTabLabel,
|
||||||
isTabRetain,
|
isTabRetain,
|
||||||
updateTabsByLocale
|
updateTabsByLocale,
|
||||||
|
getTabIdByRoute
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
4
src/typings/app.d.ts
vendored
@@ -251,6 +251,10 @@ declare namespace App {
|
|||||||
type Schema = {
|
type Schema = {
|
||||||
system: {
|
system: {
|
||||||
title: string;
|
title: string;
|
||||||
|
updateTitle: string;
|
||||||
|
updateContent: string;
|
||||||
|
updateConfirm: string;
|
||||||
|
updateCancel: string;
|
||||||
};
|
};
|
||||||
common: {
|
common: {
|
||||||
action: string;
|
action: string;
|
||||||
|
7
src/typings/router.d.ts
vendored
@@ -27,7 +27,7 @@ declare module 'vue-router' {
|
|||||||
/**
|
/**
|
||||||
* Is constant route
|
* Is constant route
|
||||||
*
|
*
|
||||||
* Does not need to login, and the route is defined in the front-end
|
* when it is set to true, there will be no login verification and no permission verification to access the route
|
||||||
*/
|
*/
|
||||||
constant?: boolean | null;
|
constant?: boolean | null;
|
||||||
/**
|
/**
|
||||||
@@ -57,7 +57,10 @@ declare module 'vue-router' {
|
|||||||
* the route is "user_detail", if it is set to "user_list", the menu "user_list" will be activated
|
* the route is "user_detail", if it is set to "user_list", the menu "user_list" will be activated
|
||||||
*/
|
*/
|
||||||
activeMenu?: import('@elegant-router/types').RouteKey | null;
|
activeMenu?: import('@elegant-router/types').RouteKey | null;
|
||||||
/** By default, the same route path will use one tab, if set to true, it will use multiple tabs */
|
/**
|
||||||
|
* By default, the same route path will use one tab, even with different query, if set true, the route with
|
||||||
|
* different query will use different tabs
|
||||||
|
*/
|
||||||
multiTab?: boolean | null;
|
multiTab?: boolean | null;
|
||||||
/** If set, the route will be fixed in tabs, and the value is the order of fixed tabs */
|
/** If set, the route will be fixed in tabs, and the value is the order of fixed tabs */
|
||||||
fixedIndexInTab?: number | null;
|
fixedIndexInTab?: number | null;
|
||||||
|
2
src/typings/storage.d.ts
vendored
@@ -18,8 +18,6 @@ declare namespace StorageType {
|
|||||||
mixSiderFixed: CommonType.YesOrNo;
|
mixSiderFixed: CommonType.YesOrNo;
|
||||||
/** The refresh token */
|
/** The refresh token */
|
||||||
refreshToken: string;
|
refreshToken: string;
|
||||||
/** The user info */
|
|
||||||
userInfo: Api.Auth.UserInfo;
|
|
||||||
/** The theme color */
|
/** The theme color */
|
||||||
themeColor: string;
|
themeColor: string;
|
||||||
/** The theme settings */
|
/** The theme settings */
|
||||||
|
@@ -6,7 +6,7 @@ import { useFormRules, useNaiveForm } from '@/hooks/common/form';
|
|||||||
import { useCaptcha } from '@/hooks/business/captcha';
|
import { useCaptcha } from '@/hooks/business/captcha';
|
||||||
|
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: 'CodeLogin'
|
name: 'Register'
|
||||||
});
|
});
|
||||||
|
|
||||||
const { toggleLoginModule } = useRouterPush();
|
const { toggleLoginModule } = useRouterPush();
|
||||||
|
@@ -374,7 +374,6 @@ watch(
|
|||||||
</NFormItemGi>
|
</NFormItemGi>
|
||||||
<NFormItemGi span="24 m:12" :label="$t('page.manage.menu.hideInMenu')" path="hideInMenu">
|
<NFormItemGi span="24 m:12" :label="$t('page.manage.menu.hideInMenu')" path="hideInMenu">
|
||||||
<NRadioGroup v-model:value="model.hideInMenu">
|
<NRadioGroup v-model:value="model.hideInMenu">
|
||||||
<!-- eslint-disable-next-line vue/prefer-true-attribute-shorthand -->
|
|
||||||
<NRadio :value="true" :label="$t('common.yesOrNo.yes')" />
|
<NRadio :value="true" :label="$t('common.yesOrNo.yes')" />
|
||||||
<NRadio :value="false" :label="$t('common.yesOrNo.no')" />
|
<NRadio :value="false" :label="$t('common.yesOrNo.no')" />
|
||||||
</NRadioGroup>
|
</NRadioGroup>
|
||||||
|
@@ -25,7 +25,7 @@ export default defineConfig(configEnv => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
plugins: setupVitePlugins(viteEnv),
|
plugins: setupVitePlugins(viteEnv, buildTime),
|
||||||
define: {
|
define: {
|
||||||
BUILD_TIME: JSON.stringify(buildTime)
|
BUILD_TIME: JSON.stringify(buildTime)
|
||||||
},
|
},
|
||||||
|