mirror of
https://github.com/soybeanjs/soybean-admin.git
synced 2025-10-14 22:03:41 +08:00
Compare commits
1 Commits
tauri-v1.2
...
tauri-v1.1
Author | SHA1 | Date | |
---|---|---|---|
|
9e05cef7a6 |
@@ -1,5 +1,5 @@
|
|||||||
# backend service base url, prod environment
|
# backend service base url, prod environment
|
||||||
VITE_SERVICE_BASE_URL=https://mock.apifox.cn/m1/3109515-0-default
|
VITE_SERVICE_BASE_URL=https://mock.apifox.com/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.cn/m1/3109515-0-default
|
VITE_SERVICE_BASE_URL=https://mock.apifox.com/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= `{
|
||||||
|
3
.vscode/settings.json
vendored
3
.vscode/settings.json
vendored
@@ -14,6 +14,5 @@
|
|||||||
"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
|
|
||||||
}
|
}
|
||||||
|
126
CHANGELOG.md
126
CHANGELOG.md
@@ -1,132 +1,6 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
|
||||||
## [v1.2.3](https://github.com/soybeanjs/soybean-admin/compare/v1.2.2...v1.2.3) (2024-06-13)
|
|
||||||
|
|
||||||
### 🐞 Bug Fixes
|
|
||||||
|
|
||||||
- **projects**:
|
|
||||||
- fix mobile browser theme issue by adding color-scheme meta tag to index.html - by @KickCashew in https://github.com/soybeanjs/soybean-admin/issues/488 [<samp>(c2125)</samp>](https://github.com/soybeanjs/soybean-admin/commit/c212565)
|
|
||||||
- Fix secondary directory components is empty - by @paynezhuang in https://github.com/soybeanjs/soybean-admin/issues/491 [<samp>(aabb2)</samp>](https://github.com/soybeanjs/soybean-admin/commit/aabb2a4)
|
|
||||||
|
|
||||||
### 📖 Documentation
|
|
||||||
|
|
||||||
- **projects**:
|
|
||||||
- Fixed the hyperlink pointing error - by **Azir** [<samp>(20a81)</samp>](https://github.com/soybeanjs/soybean-admin/commit/20a8127)
|
|
||||||
- update README - by @soybeanjs [<samp>(70261)</samp>](https://github.com/soybeanjs/soybean-admin/commit/7026126)
|
|
||||||
|
|
||||||
### 🏡 Chore
|
|
||||||
|
|
||||||
- **deps**:
|
|
||||||
- update deps - by @soybeanjs [<samp>(813d8)</samp>](https://github.com/soybeanjs/soybean-admin/commit/813d8ce)
|
|
||||||
- update deps - by @soybeanjs [<samp>(bf718)</samp>](https://github.com/soybeanjs/soybean-admin/commit/bf71837)
|
|
||||||
|
|
||||||
### ❤️ Contributors
|
|
||||||
|
|
||||||
[](https://github.com/soybeanjs) [](https://github.com/paynezhuang) [](https://github.com/KickCashew)
|
|
||||||
[Azir](mailto:2075125282@qq.com)
|
|
||||||
|
|
||||||
## [v1.2.2](https://github.com/honghuangdc/soybean-admin/compare/v1.2.1...v1.2.2) (2024-06-12)
|
|
||||||
|
|
||||||
### 🚀 Features
|
|
||||||
|
|
||||||
- **projects**: reset scroll position when tab change - by @soybeanjs [<samp>(9094b)</samp>](https://github.com/honghuangdc/soybean-admin/commit/9094b21)
|
|
||||||
|
|
||||||
### 🐞 Bug Fixes
|
|
||||||
|
|
||||||
- **projects**:
|
|
||||||
- hide AppVersionNotification in DEV mode - by @sigma-plus in https://github.com/honghuangdc/soybean-admin/issues/482 [<samp>(62592)</samp>](https://github.com/honghuangdc/soybean-admin/commit/6259287)
|
|
||||||
- fix menu-toggler hidden in mobile layout. fixed #483 - by @soybeanjs in https://github.com/honghuangdc/soybean-admin/issues/483 [<samp>(4470c)</samp>](https://github.com/honghuangdc/soybean-admin/commit/4470cb4)
|
|
||||||
|
|
||||||
### 📖 Documentation
|
|
||||||
|
|
||||||
- **projects**: update README - by @soybeanjs [<samp>(8f9a7)</samp>](https://github.com/honghuangdc/soybean-admin/commit/8f9a705)
|
|
||||||
|
|
||||||
### ❤️ Contributors
|
|
||||||
|
|
||||||
[](https://github.com/soybeanjs) [](https://github.com/sigma-plus)
|
|
||||||
|
|
||||||
## [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)
|
## [v1.1.3](https://github.com/soybeanjs/soybean-admin/compare/v1.1.2...v1.1.3) (2024-06-02)
|
||||||
|
|
||||||
### 🐞 Bug Fixes
|
### 🐞 Bug Fixes
|
||||||
|
@@ -1,67 +1,5 @@
|
|||||||
# 更新日志
|
# 更新日志
|
||||||
|
|
||||||
|
|
||||||
## [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)
|
## [v1.1.3](https://github.com/soybeanjs/soybean-admin/compare/v1.1.2...v1.1.3) (2024-06-02)
|
||||||
|
|
||||||
### 🐞 错误修复
|
### 🐞 错误修复
|
||||||
|
13
README.md
13
README.md
@@ -11,9 +11,6 @@
|
|||||||
[](https://github.com/soybeanjs/soybean-admin)
|
[](https://github.com/soybeanjs/soybean-admin)
|
||||||
[](https://gitee.com/honghuangdc/soybean-admin)
|
[](https://gitee.com/honghuangdc/soybean-admin)
|
||||||
|
|
||||||
<a href="https://hellogithub.com/repository/1298f27d5fe54959a16cf9686516ddb3" target="_blank"><img src="https://abroad.hellogithub.com/v1/widgets/recommend.svg?rid=1298f27d5fe54959a16cf9686516ddb3&claim_uid=IiDXWmP4TEntjbV" alt="Featured|HelloGitHub" style="width: 250px; height: 54px;" width="250" height="54" /></a>
|
|
||||||
|
|
||||||
|
|
||||||
> [!NOTE]
|
> [!NOTE]
|
||||||
> If you think `SoybeanAdmin` is helpful to you, or you like our project, please give us a ⭐️ on GitHub. Your support is the driving force for us to continue to improve and add new features! Thank you for your support!
|
> If you think `SoybeanAdmin` is helpful to you, or you like our project, please give us a ⭐️ on GitHub. Your support is the driving force for us to continue to improve and add new features! Thank you for your support!
|
||||||
|
|
||||||
@@ -81,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.12.0, recommended 18.19.0 or higher.
|
- **NodeJS**: >=18.0.0, recommended 18.19.0 or higher.
|
||||||
- **pnpm**: >= 8.7.0, recommended 8.14.0 or higher.
|
- **pnpm**: >= 8.0.0, recommended 8.14.0 or higher.
|
||||||
|
|
||||||
**Clone Project**
|
**Clone Project**
|
||||||
|
|
||||||
@@ -157,10 +154,10 @@ Thanks the following people for their contributions. If you want to contribute t
|
|||||||
<p>QQ Group</p>
|
<p>QQ Group</p>
|
||||||
<img src="https://soybeanjs-1300612522.cos.ap-guangzhou.myqcloud.com/uPic/qq-soybean-admin-2.jpg" style="width:200px" />
|
<img src="https://soybeanjs-1300612522.cos.ap-guangzhou.myqcloud.com/uPic/qq-soybean-admin-2.jpg" style="width:200px" />
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<!-- <div>
|
||||||
<p>WeChat Group</p>
|
<p>WeChat Group</p>
|
||||||
<img src="https://soybeanjs-1300612522.cos.ap-guangzhou.myqcloud.com/picgo/soybean-admin-wechat-0620.jpg" style="width:200px" />
|
<img src="https://soybeanjs-1300612522.cos.ap-guangzhou.myqcloud.com/uPic/wechat-0402.jpg" style="width:200px" />
|
||||||
</div>
|
</div> -->
|
||||||
<div>
|
<div>
|
||||||
<p>Add the following WeChat to invite to the WeChat group</p>
|
<p>Add the following WeChat to invite to the WeChat group</p>
|
||||||
<img src="https://soybeanjs-1300612522.cos.ap-guangzhou.myqcloud.com/uPic/wechat-soybeanjs.jpg" style="width:200px" />
|
<img src="https://soybeanjs-1300612522.cos.ap-guangzhou.myqcloud.com/uPic/wechat-soybeanjs.jpg" style="width:200px" />
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
<div align="center">
|
<div align="center">
|
||||||
<img src="./public/favicon.svg" width="160" />
|
<img src="./public/favicon.svg" width="160" />
|
||||||
<h1>SoybeanAdmin</h1>
|
<h1>SoybeanAdmin</h1>
|
||||||
<span><a href="./README.md">English</a> | 中文</span>
|
<span><a href="./README.zh_CN.md">English</a> | 中文</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
---
|
---
|
||||||
@@ -11,8 +11,6 @@
|
|||||||
[](https://github.com/soybeanjs/soybean-admin)
|
[](https://github.com/soybeanjs/soybean-admin)
|
||||||
[](https://gitee.com/honghuangdc/soybean-admin)
|
[](https://gitee.com/honghuangdc/soybean-admin)
|
||||||
|
|
||||||
<a href="https://hellogithub.com/repository/1298f27d5fe54959a16cf9686516ddb3" target="_blank"><img src="https://abroad.hellogithub.com/v1/widgets/recommend.svg?rid=1298f27d5fe54959a16cf9686516ddb3&claim_uid=IiDXWmP4TEntjbV" alt="Featured|HelloGitHub" style="width: 250px; height: 54px;" width="250" height="54" /></a>
|
|
||||||
|
|
||||||
> [!NOTE]
|
> [!NOTE]
|
||||||
> 如果您觉得 `SoybeanAdmin`对您有所帮助,或者您喜欢我们的项目,请在 GitHub 上给我们一个 ⭐️。您的支持是我们持续改进和增加新功能的动力!感谢您的支持!
|
> 如果您觉得 `SoybeanAdmin`对您有所帮助,或者您喜欢我们的项目,请在 GitHub 上给我们一个 ⭐️。您的支持是我们持续改进和增加新功能的动力!感谢您的支持!
|
||||||
|
|
||||||
@@ -79,8 +77,8 @@
|
|||||||
确保你的环境满足以下要求:
|
确保你的环境满足以下要求:
|
||||||
|
|
||||||
- **git**: 你需要git来克隆和管理项目版本。
|
- **git**: 你需要git来克隆和管理项目版本。
|
||||||
- **NodeJS**: >=18.12.0,推荐 18.19.0 或更高。
|
- **NodeJS**: >=18.0.0,推荐 18.19.0 或更高。
|
||||||
- **pnpm**: >= 8.7.0,推荐 8.14.0 或更高。
|
- **pnpm**: >= 8.0.0,推荐 8.14.0 或更高。
|
||||||
|
|
||||||
**克隆项目**
|
**克隆项目**
|
||||||
|
|
||||||
@@ -157,10 +155,10 @@ pnpm build
|
|||||||
<p>QQ交流群</p>
|
<p>QQ交流群</p>
|
||||||
<img src="https://soybeanjs-1300612522.cos.ap-guangzhou.myqcloud.com/uPic/qq-soybean-admin-2.jpg" style="width:200px" />
|
<img src="https://soybeanjs-1300612522.cos.ap-guangzhou.myqcloud.com/uPic/qq-soybean-admin-2.jpg" style="width:200px" />
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<!-- <div>
|
||||||
<p>微信群</p>
|
<p>微信群</p>
|
||||||
<img src="https://soybeanjs-1300612522.cos.ap-guangzhou.myqcloud.com/picgo/soybean-admin-wechat-0620.jpg" style="width:200px" />
|
<img src="https://soybeanjs-1300612522.cos.ap-guangzhou.myqcloud.com/uPic/wechat-0402.jpg" style="width:200px" />
|
||||||
</div>
|
</div> -->
|
||||||
<div>
|
<div>
|
||||||
<p>添加下面微信邀请进微信群</p>
|
<p>添加下面微信邀请进微信群</p>
|
||||||
<img src="https://soybeanjs-1300612522.cos.ap-guangzhou.myqcloud.com/uPic/wechat-soybeanjs.jpg" style="width:200px" />
|
<img src="https://soybeanjs-1300612522.cos.ap-guangzhou.myqcloud.com/uPic/wechat-soybeanjs.jpg" style="width:200px" />
|
||||||
|
@@ -1,13 +0,0 @@
|
|||||||
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,9 +6,8 @@ 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, buildTime: string) {
|
export function setupVitePlugins(viteEnv: Env.ImportMeta) {
|
||||||
const plugins: PluginOption = [
|
const plugins: PluginOption = [
|
||||||
vue({
|
vue({
|
||||||
script: {
|
script: {
|
||||||
@@ -20,8 +19,7 @@ export function setupVitePlugins(viteEnv: Env.ImportMeta, buildTime: string) {
|
|||||||
setupElegantRouter(),
|
setupElegantRouter(),
|
||||||
setupUnocss(viteEnv),
|
setupUnocss(viteEnv),
|
||||||
...setupUnplugin(viteEnv),
|
...setupUnplugin(viteEnv),
|
||||||
progress(),
|
progress()
|
||||||
setupHtmlPlugin(buildTime)
|
|
||||||
];
|
];
|
||||||
|
|
||||||
return plugins;
|
return plugins;
|
||||||
|
@@ -7,7 +7,7 @@ export default defineConfig(
|
|||||||
'vue/multi-word-component-names': [
|
'vue/multi-word-component-names': [
|
||||||
'warn',
|
'warn',
|
||||||
{
|
{
|
||||||
ignores: ['index', 'App', 'Register', '[id]', '[url]']
|
ignores: ['index', 'App', '[id]', '[url]']
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
'vue/component-name-in-template-casing': [
|
'vue/component-name-in-template-casing': [
|
||||||
|
@@ -4,7 +4,6 @@
|
|||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<link rel="icon" href="/favicon.svg" />
|
<link rel="icon" href="/favicon.svg" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<meta name="color-scheme" content="light dark" />
|
|
||||||
<title>%VITE_APP_TITLE%</title>
|
<title>%VITE_APP_TITLE%</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
50
package.json
50
package.json
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "soybean-admin",
|
"name": "soybean-admin",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"version": "1.2.3",
|
"version": "1.1.3",
|
||||||
"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",
|
||||||
@@ -56,7 +56,7 @@
|
|||||||
"@sa/hooks": "workspace:*",
|
"@sa/hooks": "workspace:*",
|
||||||
"@sa/materials": "workspace:*",
|
"@sa/materials": "workspace:*",
|
||||||
"@sa/utils": "workspace:*",
|
"@sa/utils": "workspace:*",
|
||||||
"@vueuse/core": "10.11.0",
|
"@vueuse/core": "10.9.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",
|
||||||
@@ -64,45 +64,45 @@
|
|||||||
"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",
|
"tailwind-merge": "^2.3.0",
|
||||||
"vue": "3.4.27",
|
"vue": "3.4.27",
|
||||||
"vue-draggable-plus": "0.5.0",
|
"vue-draggable-plus": "0.4.1",
|
||||||
"vue-i18n": "9.13.1",
|
"vue-i18n": "9.13.1",
|
||||||
"vue-router": "4.3.3"
|
"vue-router": "4.3.2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@elegant-router/vue": "0.3.7",
|
"@elegant-router/vue": "0.3.7",
|
||||||
"@iconify/json": "2.2.218",
|
"@iconify/json": "2.2.211",
|
||||||
"@sa/scripts": "workspace:*",
|
"@sa/scripts": "workspace:*",
|
||||||
"@sa/uno-preset": "workspace:*",
|
"@sa/uno-preset": "workspace:*",
|
||||||
"@soybeanjs/eslint-config": "1.3.6",
|
"@soybeanjs/eslint-config": "1.3.5",
|
||||||
"@tauri-apps/cli": "1.5.14",
|
"@tauri-apps/cli": "1.5.11",
|
||||||
"@types/lodash-es": "4.17.12",
|
"@types/lodash-es": "4.17.12",
|
||||||
"@types/node": "20.14.2",
|
"@types/node": "20.12.12",
|
||||||
"@types/nprogress": "0.2.3",
|
"@types/nprogress": "0.2.3",
|
||||||
"@unocss/eslint-config": "0.61.0",
|
"@unocss/eslint-config": "0.60.2",
|
||||||
"@unocss/preset-icons": "0.61.0",
|
"@unocss/preset-icons": "0.60.2",
|
||||||
"@unocss/preset-uno": "0.61.0",
|
"@unocss/preset-uno": "0.60.2",
|
||||||
"@unocss/transformer-directives": "0.61.0",
|
"@unocss/transformer-directives": "0.60.2",
|
||||||
"@unocss/transformer-variant-group": "0.61.0",
|
"@unocss/transformer-variant-group": "0.60.2",
|
||||||
"@unocss/vite": "0.61.0",
|
"@unocss/vite": "0.60.2",
|
||||||
"@vitejs/plugin-vue": "5.0.5",
|
"@vitejs/plugin-vue": "5.0.4",
|
||||||
"@vitejs/plugin-vue-jsx": "4.0.0",
|
"@vitejs/plugin-vue-jsx": "3.1.0",
|
||||||
"eslint": "9.4.0",
|
"eslint": "9.3.0",
|
||||||
"eslint-plugin-vue": "9.26.0",
|
"eslint-plugin-vue": "9.26.0",
|
||||||
"lint-staged": "15.2.7",
|
"lint-staged": "15.2.2",
|
||||||
"sass": "1.77.5",
|
"sass": "1.77.2",
|
||||||
"simple-git-hooks": "2.11.1",
|
"simple-git-hooks": "2.11.1",
|
||||||
"tsx": "4.15.4",
|
"tsx": "4.10.5",
|
||||||
"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.3.0",
|
"vite": "5.2.11",
|
||||||
"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.1",
|
"vite-plugin-vue-devtools": "7.2.0",
|
||||||
"vue-eslint-parser": "9.4.3",
|
"vue-eslint-parser": "9.4.2",
|
||||||
"vue-tsc": "2.0.21"
|
"vue-tsc": "2.0.19"
|
||||||
},
|
},
|
||||||
"simple-git-hooks": {
|
"simple-git-hooks": {
|
||||||
"commit-msg": "pnpm sa git-commit-verify",
|
"commit-msg": "pnpm sa git-commit-verify",
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@sa/axios",
|
"name": "@sa/axios",
|
||||||
"version": "1.2.3",
|
"version": "1.1.3",
|
||||||
"exports": {
|
"exports": {
|
||||||
".": "./src/index.ts"
|
".": "./src/index.ts"
|
||||||
},
|
},
|
||||||
@@ -11,8 +11,8 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@sa/utils": "workspace:*",
|
"@sa/utils": "workspace:*",
|
||||||
"axios": "1.7.2",
|
"axios": "1.6.8",
|
||||||
"axios-retry": "4.4.0",
|
"axios-retry": "4.2.0",
|
||||||
"qs": "6.12.1"
|
"qs": "6.12.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@sa/color",
|
"name": "@sa/color",
|
||||||
"version": "1.2.3",
|
"version": "1.1.3",
|
||||||
"exports": {
|
"exports": {
|
||||||
".": "./src/index.ts"
|
".": "./src/index.ts"
|
||||||
},
|
},
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@sa/hooks",
|
"name": "@sa/hooks",
|
||||||
"version": "1.2.3",
|
"version": "1.1.3",
|
||||||
"exports": {
|
"exports": {
|
||||||
".": "./src/index.ts"
|
".": "./src/index.ts"
|
||||||
},
|
},
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@sa/materials",
|
"name": "@sa/materials",
|
||||||
"version": "1.2.3",
|
"version": "1.1.3",
|
||||||
"exports": {
|
"exports": {
|
||||||
".": "./src/index.ts"
|
".": "./src/index.ts"
|
||||||
},
|
},
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@sa/fetch",
|
"name": "@sa/fetch",
|
||||||
"version": "1.2.3",
|
"version": "1.1.3",
|
||||||
"exports": {
|
"exports": {
|
||||||
".": "./src/index.ts"
|
".": "./src/index.ts"
|
||||||
},
|
},
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@sa/scripts",
|
"name": "@sa/scripts",
|
||||||
"version": "1.2.3",
|
"version": "1.1.3",
|
||||||
"bin": {
|
"bin": {
|
||||||
"sa": "./bin.ts"
|
"sa": "./bin.ts"
|
||||||
},
|
},
|
||||||
@@ -13,13 +13,13 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@soybeanjs/changelog": "0.3.24",
|
"@soybeanjs/changelog": "0.3.23",
|
||||||
"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.2.0",
|
"execa": "9.1.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.2.3",
|
"version": "1.1.3",
|
||||||
"exports": {
|
"exports": {
|
||||||
".": "./src/index.ts"
|
".": "./src/index.ts"
|
||||||
},
|
},
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@sa/utils",
|
"name": "@sa/utils",
|
||||||
"version": "1.2.3",
|
"version": "1.1.3",
|
||||||
"exports": {
|
"exports": {
|
||||||
".": "./src/index.ts"
|
".": "./src/index.ts"
|
||||||
},
|
},
|
||||||
|
1945
pnpm-lock.yaml
generated
1945
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@@ -41,7 +41,6 @@ const icon = computed(() => {
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<ButtonIcon
|
<ButtonIcon
|
||||||
:key="String(collapsed)"
|
|
||||||
:tooltip-content="collapsed ? $t('icon.expand') : $t('icon.collapse')"
|
:tooltip-content="collapsed ? $t('icon.expand') : $t('icon.collapse')"
|
||||||
tooltip-placement="bottom-start"
|
tooltip-placement="bottom-start"
|
||||||
:z-index="zIndex"
|
:z-index="zIndex"
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { computed } from 'vue';
|
import { computed } from 'vue';
|
||||||
import { LAYOUT_SCROLL_EL_ID } from '@sa/materials';
|
|
||||||
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';
|
||||||
@@ -25,12 +24,6 @@ const routeStore = useRouteStore();
|
|||||||
const tabStore = useTabStore();
|
const tabStore = useTabStore();
|
||||||
|
|
||||||
const transitionName = computed(() => (themeStore.page.animate ? themeStore.page.animateMode : ''));
|
const transitionName = computed(() => (themeStore.page.animate ? themeStore.page.animateMode : ''));
|
||||||
|
|
||||||
function resetScroll() {
|
|
||||||
const el = document.querySelector(`#${LAYOUT_SCROLL_EL_ID}`);
|
|
||||||
|
|
||||||
el?.scrollTo({ left: 0, top: 0 });
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@@ -39,7 +32,6 @@ function resetScroll() {
|
|||||||
:name="transitionName"
|
:name="transitionName"
|
||||||
mode="out-in"
|
mode="out-in"
|
||||||
@before-leave="appStore.setContentXScrollable(true)"
|
@before-leave="appStore.setContentXScrollable(true)"
|
||||||
@after-leave="resetScroll"
|
|
||||||
@after-enter="appStore.setContentXScrollable(false)"
|
@after-enter="appStore.setContentXScrollable(false)"
|
||||||
>
|
>
|
||||||
<KeepAlive :include="routeStore.cacheRoutes">
|
<KeepAlive :include="routeStore.cacheRoutes">
|
||||||
|
@@ -1,10 +1,6 @@
|
|||||||
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,10 +1,6 @@
|
|||||||
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 { setupAppVersionNotification, setupDayjs, setupIconifyOffline, setupLoading, setupNProgress } from './plugins';
|
import { 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,8 +23,6 @@ async function setupApp() {
|
|||||||
|
|
||||||
setupI18n(app);
|
setupI18n(app);
|
||||||
|
|
||||||
setupAppVersionNotification();
|
|
||||||
|
|
||||||
app.mount('#app');
|
app.mount('#app');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,53 +0,0 @@
|
|||||||
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 (!import.meta.env.DEV && 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,4 +2,3 @@ export * from './loading';
|
|||||||
export * from './nprogress';
|
export * from './nprogress';
|
||||||
export * from './iconify';
|
export * from './iconify';
|
||||||
export * from './dayjs';
|
export * from './dayjs';
|
||||||
export * from './app';
|
|
||||||
|
@@ -92,7 +92,6 @@ 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';
|
||||||
@@ -161,8 +160,6 @@ 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,10 +64,9 @@ export const request = createFlatRequest<App.Service.Response, RequestInstanceSt
|
|||||||
|
|
||||||
window.$dialog?.error({
|
window.$dialog?.error({
|
||||||
title: 'Error',
|
title: 'Error',
|
||||||
content: response.data.msg,
|
content: response.data.code,
|
||||||
positiveText: $t('common.confirm'),
|
positiveText: $t('common.confirm'),
|
||||||
maskClosable: false,
|
maskClosable: false,
|
||||||
closeOnEsc: false,
|
|
||||||
onPositiveClick() {
|
onPositiveClick() {
|
||||||
logoutAndCleanup();
|
logoutAndCleanup();
|
||||||
},
|
},
|
||||||
|
@@ -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 } from './shared';
|
import { clearAuthStorage, getToken, getUserInfo } from './shared';
|
||||||
|
|
||||||
export const useAuthStore = defineStore(SetupStoreId.Auth, () => {
|
export const useAuthStore = defineStore(SetupStoreId.Auth, () => {
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
@@ -18,12 +18,7 @@ export const useAuthStore = defineStore(SetupStoreId.Auth, () => {
|
|||||||
|
|
||||||
const token = ref(getToken());
|
const token = ref(getToken());
|
||||||
|
|
||||||
const userInfo: Api.Auth.UserInfo = reactive({
|
const userInfo: Api.Auth.UserInfo = reactive(getUserInfo());
|
||||||
userId: '',
|
|
||||||
userName: '',
|
|
||||||
roles: [],
|
|
||||||
buttons: []
|
|
||||||
});
|
|
||||||
|
|
||||||
/** is super role in static route */
|
/** is super role in static route */
|
||||||
const isStaticSuper = computed(() => {
|
const isStaticSuper = computed(() => {
|
||||||
@@ -92,23 +87,14 @@ 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) {
|
||||||
// update store
|
// 2. store user info
|
||||||
|
localStg.set('userInfo', info);
|
||||||
|
|
||||||
|
// 3. update store
|
||||||
|
token.value = loginToken.token;
|
||||||
Object.assign(userInfo, info);
|
Object.assign(userInfo, info);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@@ -117,18 +103,6 @@ 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,
|
||||||
@@ -136,7 +110,6 @@ export const useAuthStore = defineStore(SetupStoreId.Auth, () => {
|
|||||||
isLogin,
|
isLogin,
|
||||||
loginLoading,
|
loginLoading,
|
||||||
resetStore,
|
resetStore,
|
||||||
login,
|
login
|
||||||
initUserInfo
|
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
@@ -5,8 +5,27 @@ 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');
|
||||||
}
|
}
|
||||||
|
4
src/typings/app.d.ts
vendored
4
src/typings/app.d.ts
vendored
@@ -251,10 +251,6 @@ 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
7
src/typings/router.d.ts
vendored
@@ -27,7 +27,7 @@ declare module 'vue-router' {
|
|||||||
/**
|
/**
|
||||||
* Is constant route
|
* Is constant route
|
||||||
*
|
*
|
||||||
* when it is set to true, there will be no login verification and no permission verification to access the route
|
* Does not need to login, and the route is defined in the front-end
|
||||||
*/
|
*/
|
||||||
constant?: boolean | null;
|
constant?: boolean | null;
|
||||||
/**
|
/**
|
||||||
@@ -57,10 +57,7 @@ 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
2
src/typings/storage.d.ts
vendored
@@ -18,6 +18,8 @@ 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: 'Register'
|
name: 'CodeLogin'
|
||||||
});
|
});
|
||||||
|
|
||||||
const { toggleLoginModule } = useRouterPush();
|
const { toggleLoginModule } = useRouterPush();
|
||||||
|
@@ -6,7 +6,7 @@ export function getLayoutAndPage(component?: string | null) {
|
|||||||
let layout = '';
|
let layout = '';
|
||||||
let page = '';
|
let page = '';
|
||||||
|
|
||||||
const [layoutOrPage = '', pageItem = ''] = component?.split(FIRST_LEVEL_ROUTE_COMPONENT_SPLIT) || [];
|
const [layoutOrPage, pageItem] = component?.split(FIRST_LEVEL_ROUTE_COMPONENT_SPLIT) || [];
|
||||||
|
|
||||||
layout = getLayout(layoutOrPage);
|
layout = getLayout(layoutOrPage);
|
||||||
page = getPage(pageItem || layoutOrPage);
|
page = getPage(pageItem || layoutOrPage);
|
||||||
|
@@ -25,7 +25,7 @@ export default defineConfig(configEnv => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
plugins: setupVitePlugins(viteEnv, buildTime),
|
plugins: setupVitePlugins(viteEnv),
|
||||||
define: {
|
define: {
|
||||||
BUILD_TIME: JSON.stringify(buildTime)
|
BUILD_TIME: JSON.stringify(buildTime)
|
||||||
},
|
},
|
||||||
|
Reference in New Issue
Block a user