Compare commits

...

19 Commits

Author SHA1 Message Date
Soybean
17d2c9eba1 chore(release): release tauri v1.2.2 2024-06-12 11:10:54 +08:00
Soybean
ec8cadd183 chore(projects): release v1.2.2 2024-06-12 11:09:42 +08:00
Soybean
4470cb4e8c fix(projects): fix menu-toggler hidden in mobile layout. fixed #483 2024-06-12 10:25:11 +08:00
Soybean
8f9a70505c docs(projects): update README 2024-06-12 10:16:16 +08:00
Soybean
9094b21cbb feat(projects): reset scroll position when tab change 2024-06-11 19:04:07 +08:00
Alue Gitman
6259287240 fix(projects): hide AppVersionNotification in DEV mode (#482) 2024-06-07 16:06:33 +08:00
Soybean
22004ff4dc chore(projects): release v1.2.1 2024-06-07 11:55:07 +08:00
Soybean
08827a42a3 chore(deps): update deps 2024-06-07 11:54:45 +08:00
Soybean
6a6eb9afd6 fix(projects): fix setupAppVersionNotification render 2024-06-07 11:54:38 +08:00
Soybean
ff51b72dac fix(projects): fix get user info when page reload 2024-06-07 11:54:06 +08:00
Soybean
fe06b8c499 docs(projects): update CHANGELOG 2024-06-06 23:33:16 +08:00
Soybean
4b63bbcf67 chore(projects): release v1.2.0 2024-06-06 23:31:43 +08:00
Soybean
5531a68641 feat(projects): get user info in router guard and remove in localStorage. close #459 2024-06-06 23:31:06 +08:00
Soybean
584cd54d6d feat(projects): support system new version update notification. close #420 2024-06-06 23:31:00 +08:00
Soybean
2bec899031 docs(projects): update CHANGELOG 2024-06-06 23:30:21 +08:00
Soybean
83862ba76e chore(projects): release v1.1.5 2024-06-06 23:26:15 +08:00
Soybean
060c0a91c7 chore(deps): update deps 2024-06-06 23:23:13 +08:00
Soybean
76649e2a08 chore(projects): update vscode settings: vue official 2024-06-06 19:17:27 +08:00
马铃薯头
ddf3823a55 fix(projects): fix register name, CodeLogin => Register (#478) 2024-06-06 15:57:58 +08:00
55 changed files with 4220 additions and 79 deletions

View File

@@ -15,5 +15,5 @@
"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": false "vue.server.hybridMode": true
} }

View File

@@ -1,6 +1,77 @@
# Changelog # Changelog
## [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 &nbsp;-&nbsp; by @soybeanjs [<samp>(9094b)</samp>](https://github.com/honghuangdc/soybean-admin/commit/9094b21)
### &nbsp;&nbsp;&nbsp;🐞 Bug Fixes
- **projects**:
- hide AppVersionNotification in DEV mode &nbsp;-&nbsp; 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 &nbsp;-&nbsp; by @soybeanjs in https://github.com/honghuangdc/soybean-admin/issues/483 [<samp>(4470c)</samp>](https://github.com/honghuangdc/soybean-admin/commit/4470cb4)
### &nbsp;&nbsp;&nbsp;📖 Documentation
- **projects**: update README &nbsp;-&nbsp; by @soybeanjs [<samp>(8f9a7)</samp>](https://github.com/honghuangdc/soybean-admin/commit/8f9a705)
### &nbsp;&nbsp;&nbsp;❤️ Contributors
[![soybeanjs](https://github.com/soybeanjs.png?size=48)](https://github.com/soybeanjs)&nbsp;&nbsp;[![sigma-plus](https://github.com/sigma-plus.png?size=48)](https://github.com/sigma-plus)&nbsp;&nbsp;
## [v1.2.1](https://github.com/honghuangdc/soybean-admin/compare/v1.2.0...v1.2.1) (2024-06-07)
### &nbsp;&nbsp;&nbsp;🐞 Bug Fixes
- **projects**:
- fix get user info when page reload &nbsp;-&nbsp; by @soybeanjs [<samp>(ff51b)</samp>](https://github.com/honghuangdc/soybean-admin/commit/ff51b72)
- fix setupAppVersionNotification render &nbsp;-&nbsp; by @soybeanjs [<samp>(6a6eb)</samp>](https://github.com/honghuangdc/soybean-admin/commit/6a6eb9a)
### &nbsp;&nbsp;&nbsp;📖 Documentation
- **projects**: update CHANGELOG &nbsp;-&nbsp; by @soybeanjs [<samp>(fe06b)</samp>](https://github.com/honghuangdc/soybean-admin/commit/fe06b8c)
### &nbsp;&nbsp;&nbsp;🏡 Chore
- **deps**: update deps &nbsp;-&nbsp; by @soybeanjs [<samp>(08827)</samp>](https://github.com/honghuangdc/soybean-admin/commit/08827a4)
### &nbsp;&nbsp;&nbsp;❤️ Contributors
[![soybeanjs](https://github.com/soybeanjs.png?size=48)](https://github.com/soybeanjs)&nbsp;&nbsp;
## [v1.2.0](https://github.com/soybeanjs/soybean-admin/compare/v1.1.5...v1.2.0) (2024-06-06)
### &nbsp;&nbsp;&nbsp;🚀 Features
- **projects**:
- support system new version update notification. close #420 &nbsp;-&nbsp; 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 &nbsp;-&nbsp; by @soybeanjs in https://github.com/soybeanjs/soybean-admin/issues/459 [<samp>(5531a)</samp>](https://github.com/soybeanjs/soybean-admin/commit/5531a68)
### &nbsp;&nbsp;&nbsp;📖 Documentation
- **projects**: update CHANGELOG &nbsp;-&nbsp; by @soybeanjs [<samp>(2bec8)</samp>](https://github.com/soybeanjs/soybean-admin/commit/2bec899)
### &nbsp;&nbsp;&nbsp;❤️ Contributors
[![soybeanjs](https://github.com/soybeanjs.png?size=48)](https://github.com/soybeanjs)&nbsp;&nbsp;
## [v1.1.5](https://github.com/soybeanjs/soybean-admin/compare/v1.1.4...v1.1.5) (2024-06-06)
### &nbsp;&nbsp;&nbsp;🐞 Bug Fixes
- **projects**: fix register name, CodeLogin => Register &nbsp;-&nbsp; by @m-xlsea in https://github.com/soybeanjs/soybean-admin/issues/478 [<samp>(ddf38)</samp>](https://github.com/soybeanjs/soybean-admin/commit/ddf3823)
### &nbsp;&nbsp;&nbsp;🏡 Chore
- **deps**: update deps &nbsp;-&nbsp; by @soybeanjs [<samp>(060c0)</samp>](https://github.com/soybeanjs/soybean-admin/commit/060c0a9)
- **projects**: update vscode settings: vue official &nbsp;-&nbsp; by @soybeanjs [<samp>(76649)</samp>](https://github.com/soybeanjs/soybean-admin/commit/76649e2)
### &nbsp;&nbsp;&nbsp;❤️ Contributors
[![soybeanjs](https://github.com/soybeanjs.png?size=48)](https://github.com/soybeanjs)&nbsp;&nbsp;[![m-xlsea](https://github.com/m-xlsea.png?size=48)](https://github.com/m-xlsea)&nbsp;&nbsp;
## [v1.1.4](https://github.com/honghuangdc/soybean-admin/compare/v1.1.3...v1.1.4) (2024-06-06) ## [v1.1.4](https://github.com/honghuangdc/soybean-admin/compare/v1.1.3...v1.1.4) (2024-06-06)
### &nbsp;&nbsp;&nbsp;🐞 Bug Fixes ### &nbsp;&nbsp;&nbsp;🐞 Bug Fixes

View File

@@ -1,5 +1,67 @@
# 更新日志 # 更新日志
## [v1.2.0](https://github.com/soybeanjs/soybean-admin/compare/v1.1.5...v1.2.0) (2024-06-06)
### &nbsp;&nbsp;&nbsp;🚀 功能
- **项目**:
- 支持系统新版本更新通知。关闭 #420 &nbsp;-&nbsp;@soybeanjs 在 https://github.com/soybeanjs/soybean-admin/issues/420 [<samp>(584cd)</samp>](https://github.com/soybeanjs/soybean-admin/commit/584cd54)
- 在路由守卫中获取用户信息并从localStorage中移除。关闭 #459 &nbsp;-&nbsp;@soybeanjs 在 https://github.com/soybeanjs/soybean-admin/issues/459 [<samp>(5531a)</samp>](https://github.com/soybeanjs/soybean-admin/commit/5531a68)
### &nbsp;&nbsp;&nbsp;📖 文档
- **项目**: 更新CHANGELOG &nbsp;-&nbsp;@soybeanjs [<samp>(2bec8)</samp>](https://github.com/soybeanjs/soybean-admin/commit/2bec899)
### &nbsp;&nbsp;&nbsp;❤️ 贡献者
[![soybeanjs](https://github.com/soybeanjs.png?size=48)](https://github.com/soybeanjs)&nbsp;&nbsp;
## [v1.1.5](https://github.com/soybeanjs/soybean-admin/compare/v1.1.4...v1.1.5) (2024-06-06)
### &nbsp;&nbsp;&nbsp;🐞 错误修复
- **项目**: 修复注册组件名CodeLogin => Register &nbsp;-&nbsp;@m-xlsea 在 https://github.com/soybeanjs/soybean-admin/issues/478 [<samp>(ddf38)</samp>](https://github.com/soybeanjs/soybean-admin/commit/ddf3823)
### &nbsp;&nbsp;&nbsp;🏡 杂务
- **依赖**: 更新依赖 &nbsp;-&nbsp;@soybeanjs [<samp>(060c0)</samp>](https://github.com/soybeanjs/soybean-admin/commit/060c0a9)
- **项目**: 更新 vscode 设置: vue 官方 &nbsp;-&nbsp;@soybeanjs [<samp>(76649)</samp>](https://github.com/soybeanjs/soybean-admin/commit/76649e2)
### &nbsp;&nbsp;&nbsp;❤️ 贡献者
[![soybeanjs](https://github.com/soybeanjs.png?size=48)](https://github.com/soybeanjs)&nbsp;&nbsp;[![m-xlsea](https://github.com/m-xlsea.png?size=48)](https://github.com/m-xlsea)&nbsp;&nbsp;
## [v1.1.4](https://github.com/honghuangdc/soybean-admin/compare/v1.1.3...v1.1.4) (2024-06-06)
### &nbsp;&nbsp;&nbsp;🐞 错误修复
- **utils**: 修复了按esc键时modalLogout的错误 &nbsp;-&nbsp;@sigma-plus 在 https://github.com/honghuangdc/soybean-admin/issues/470 中提出 [<samp>(bd69c)</samp>](https://github.com/honghuangdc/soybean-admin/commit/bd69c00)
### &nbsp;&nbsp;&nbsp;🛠 优化
- **projects**: 优化了RouteMeta的备注 &nbsp;-&nbsp;@soybeanjs 提出 [<samp>(ffb48)</samp>](https://github.com/honghuangdc/soybean-admin/commit/ffb48b1)
### &nbsp;&nbsp;&nbsp;📖 文档
- **projects**:
- 更新了CHANGELOG &nbsp;-&nbsp;@soybeanjs 提出 [<samp>(756f8)</samp>](https://github.com/honghuangdc/soybean-admin/commit/756f84a)
- 更新了Node&pnpm版本 &nbsp;-&nbsp;@Azir-11 在 https://github.com/honghuangdc/soybean-admin/issues/472 中提出 [<samp>(9b05d)</samp>](https://github.com/honghuangdc/soybean-admin/commit/9b05d73)
### &nbsp;&nbsp;&nbsp;🏡 杂项
- **deps**:
- 更新了依赖 &nbsp;-&nbsp;@soybeanjs 提出 [<samp>(d0380)</samp>](https://github.com/honghuangdc/soybean-admin/commit/d0380ce)
- 更新了依赖 &nbsp;-&nbsp;@soybeanjs 提出 [<samp>(1f464)</samp>](https://github.com/honghuangdc/soybean-admin/commit/1f4647b)
- **projects**:
- 关闭了http代理 &nbsp;-&nbsp;@soybeanjs 提出 [<samp>(d08a3)</samp>](https://github.com/honghuangdc/soybean-admin/commit/d08a381)
- 更新了mock url &nbsp;-&nbsp;@soybeanjs 提出 [<samp>(e6086)</samp>](https://github.com/honghuangdc/soybean-admin/commit/e6086f0)
- 更新了vscode设置 &nbsp;-&nbsp;@soybeanjs 提出 [<samp>(910df)</samp>](https://github.com/honghuangdc/soybean-admin/commit/910dfca)
### &nbsp;&nbsp;&nbsp;❤️ 贡献者
[![soybeanjs](https://github.com/soybeanjs.png?size=48)](https://github.com/soybeanjs)&nbsp;&nbsp;[![Azir-11](https://github.com/Azir-11.png?size=48)](https://github.com/Azir-11)&nbsp;&nbsp;[![sigma-plus](https://github.com/sigma-plus.png?size=48)](https://github.com/sigma-plus)&nbsp;&nbsp;
## [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)
### &nbsp;&nbsp;&nbsp;🐞 错误修复 ### &nbsp;&nbsp;&nbsp;🐞 错误修复

View File

@@ -11,6 +11,9 @@
[![github forks](https://img.shields.io/github/forks/soybeanjs/soybean-admin)](https://github.com/soybeanjs/soybean-admin) [![github forks](https://img.shields.io/github/forks/soybeanjs/soybean-admin)](https://github.com/soybeanjs/soybean-admin)
[![gitee stars](https://gitee.com/honghuangdc/soybean-admin/badge/star.svg)](https://gitee.com/honghuangdc/soybean-admin) [![gitee stars](https://gitee.com/honghuangdc/soybean-admin/badge/star.svg)](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="FeaturedHelloGitHub" 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!

View File

@@ -11,6 +11,8 @@
[![github forks](https://img.shields.io/github/forks/honghuangdc/soybean-admin)](https://github.com/soybeanjs/soybean-admin) [![github forks](https://img.shields.io/github/forks/honghuangdc/soybean-admin)](https://github.com/soybeanjs/soybean-admin)
[![gitee stars](https://gitee.com/honghuangdc/soybean-admin/badge/star.svg)](https://gitee.com/honghuangdc/soybean-admin) [![gitee stars](https://gitee.com/honghuangdc/soybean-admin/badge/star.svg)](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="FeaturedHelloGitHub" style="width: 250px; height: 54px;" width="250" height="54" /></a>
> [!NOTE] > [!NOTE]
> 如果您觉得 `SoybeanAdmin`对您有所帮助,或者您喜欢我们的项目,请在 GitHub 上给我们一个 ⭐️。您的支持是我们持续改进和增加新功能的动力!感谢您的支持! > 如果您觉得 `SoybeanAdmin`对您有所帮助,或者您喜欢我们的项目,请在 GitHub 上给我们一个 ⭐️。您的支持是我们持续改进和增加新功能的动力!感谢您的支持!

13
build/plugins/html.ts Normal file
View 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;
}

View File

@@ -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;

View File

@@ -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': [

View File

@@ -1,7 +1,7 @@
{ {
"name": "soybean-admin", "name": "soybean-admin",
"type": "module", "type": "module",
"version": "1.1.4", "version": "1.2.2",
"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"
}, },
@@ -69,10 +72,11 @@
}, },
"devDependencies": { "devDependencies": {
"@elegant-router/vue": "0.3.7", "@elegant-router/vue": "0.3.7",
"@iconify/json": "2.2.216", "@iconify/json": "2.2.217",
"@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.6",
"@tauri-apps/cli": "1.5.14",
"@types/lodash-es": "4.17.12", "@types/lodash-es": "4.17.12",
"@types/node": "20.14.2", "@types/node": "20.14.2",
"@types/nprogress": "0.2.3", "@types/nprogress": "0.2.3",
@@ -89,7 +93,7 @@
"lint-staged": "15.2.5", "lint-staged": "15.2.5",
"sass": "1.77.4", "sass": "1.77.4",
"simple-git-hooks": "2.11.1", "simple-git-hooks": "2.11.1",
"tsx": "4.11.2", "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",

View File

@@ -1,6 +1,6 @@
{ {
"name": "@sa/axios", "name": "@sa/axios",
"version": "1.1.4", "version": "1.2.2",
"exports": { "exports": {
".": "./src/index.ts" ".": "./src/index.ts"
}, },

View File

@@ -1,6 +1,6 @@
{ {
"name": "@sa/color", "name": "@sa/color",
"version": "1.1.4", "version": "1.2.2",
"exports": { "exports": {
".": "./src/index.ts" ".": "./src/index.ts"
}, },

View File

@@ -1,6 +1,6 @@
{ {
"name": "@sa/hooks", "name": "@sa/hooks",
"version": "1.1.4", "version": "1.2.2",
"exports": { "exports": {
".": "./src/index.ts" ".": "./src/index.ts"
}, },

View File

@@ -1,6 +1,6 @@
{ {
"name": "@sa/materials", "name": "@sa/materials",
"version": "1.1.4", "version": "1.2.2",
"exports": { "exports": {
".": "./src/index.ts" ".": "./src/index.ts"
}, },

View File

@@ -1,6 +1,6 @@
{ {
"name": "@sa/fetch", "name": "@sa/fetch",
"version": "1.1.4", "version": "1.2.2",
"exports": { "exports": {
".": "./src/index.ts" ".": "./src/index.ts"
}, },

View File

@@ -1,6 +1,6 @@
{ {
"name": "@sa/scripts", "name": "@sa/scripts",
"version": "1.1.4", "version": "1.2.2",
"bin": { "bin": {
"sa": "./bin.ts" "sa": "./bin.ts"
}, },
@@ -19,7 +19,7 @@
"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"

View File

@@ -1,6 +1,6 @@
{ {
"name": "@sa/uno-preset", "name": "@sa/uno-preset",
"version": "1.1.4", "version": "1.2.2",
"exports": { "exports": {
".": "./src/index.ts" ".": "./src/index.ts"
}, },

View File

@@ -1,6 +1,6 @@
{ {
"name": "@sa/utils", "name": "@sa/utils",
"version": "1.1.4", "version": "1.2.2",
"exports": { "exports": {
".": "./src/index.ts" ".": "./src/index.ts"
}, },

190
pnpm-lock.yaml generated
View File

@@ -73,8 +73,8 @@ importers:
specifier: 0.3.7 specifier: 0.3.7
version: 0.3.7 version: 0.3.7
'@iconify/json': '@iconify/json':
specifier: 2.2.216 specifier: 2.2.217
version: 2.2.216 version: 2.2.217
'@sa/scripts': '@sa/scripts':
specifier: workspace:* specifier: workspace:*
version: link:packages/scripts version: link:packages/scripts
@@ -84,6 +84,9 @@ importers:
'@soybeanjs/eslint-config': '@soybeanjs/eslint-config':
specifier: 1.3.6 specifier: 1.3.6
version: 1.3.6(@unocss/eslint-config@0.60.4(eslint@9.4.0)(typescript@5.4.5))(eslint-plugin-vue@9.26.0(eslint@9.4.0))(eslint@9.4.0)(typescript@5.4.5)(vue-eslint-parser@9.4.3(eslint@9.4.0)) version: 1.3.6(@unocss/eslint-config@0.60.4(eslint@9.4.0)(typescript@5.4.5))(eslint-plugin-vue@9.26.0(eslint@9.4.0))(eslint@9.4.0)(typescript@5.4.5)(vue-eslint-parser@9.4.3(eslint@9.4.0))
'@tauri-apps/cli':
specifier: 1.5.14
version: 1.5.14
'@types/lodash-es': '@types/lodash-es':
specifier: 4.17.12 specifier: 4.17.12
version: 4.17.12 version: 4.17.12
@@ -133,8 +136,8 @@ importers:
specifier: 2.11.1 specifier: 2.11.1
version: 2.11.1 version: 2.11.1
tsx: tsx:
specifier: 4.11.2 specifier: 4.12.0
version: 4.11.2 version: 4.12.0
typescript: typescript:
specifier: 5.4.5 specifier: 5.4.5
version: 5.4.5 version: 5.4.5
@@ -237,8 +240,8 @@ importers:
specifier: 2.4.1 specifier: 2.4.1
version: 2.4.1 version: 2.4.1
execa: execa:
specifier: 9.1.0 specifier: 9.2.0
version: 9.1.0 version: 9.2.0
kolorist: kolorist:
specifier: 1.8.0 specifier: 1.8.0
version: 1.8.0 version: 1.8.0
@@ -661,8 +664,8 @@ packages:
resolution: {integrity: sha512-d2CGZR2o7fS6sWB7DG/3a95bGKQyHMACZ5aW8qGkkqQpUoZV6C0X7Pc7l4ZNMZkfNBf4VWNe9E1jRsf0G146Ew==} resolution: {integrity: sha512-d2CGZR2o7fS6sWB7DG/3a95bGKQyHMACZ5aW8qGkkqQpUoZV6C0X7Pc7l4ZNMZkfNBf4VWNe9E1jRsf0G146Ew==}
engines: {node: '>=18.18'} engines: {node: '>=18.18'}
'@iconify/json@2.2.216': '@iconify/json@2.2.217':
resolution: {integrity: sha512-dS2yVIAel1oIAGnaxR+EJyDRjKV9GGm9tUd8Pd8VEF91HB4HJrsMzkvz23GHDWyIITGdinx4ZUjMz3hOAv+D4Q==} resolution: {integrity: sha512-+sSR9iKsoThUmgG4wA9xdtyazROIqMOo5h5otOXYRyOQjMNJCpJltq5hEhHInC5aG/DUQmXDiN/YsCoJdCYUbQ==}
'@iconify/types@2.0.0': '@iconify/types@2.0.0':
resolution: {integrity: sha512-+wluvCrRhXrhyOmRDJ3q8mux9JkKy5SJ/v8ol2tu4FVjyYvtEzkc/3pK15ET6RKg4b4w4BmTk1+gsCUhf21Ykg==} resolution: {integrity: sha512-+wluvCrRhXrhyOmRDJ3q8mux9JkKy5SJ/v8ol2tu4FVjyYvtEzkc/3pK15ET6RKg4b4w4BmTk1+gsCUhf21Ykg==}
@@ -967,6 +970,75 @@ packages:
resolution: {integrity: sha512-+PmQX0PiAYPMeVYe237LJAYvOMYW1j2rH5YROyS3b4CTVJum34HfRvKvAzozHAQG0TnHNdUfY9nCeUyRAs//cw==} resolution: {integrity: sha512-+PmQX0PiAYPMeVYe237LJAYvOMYW1j2rH5YROyS3b4CTVJum34HfRvKvAzozHAQG0TnHNdUfY9nCeUyRAs//cw==}
engines: {node: '>=14.16'} engines: {node: '>=14.16'}
'@tauri-apps/cli-darwin-arm64@1.5.14':
resolution: {integrity: sha512-lxoSOp3KKSqzHJa7iT32dukPGMlfsTuja1xXSgwR8o/fqzpYJY7FY/3ZxesP8HR66FcK+vtqa//HNqeOQ0mHkA==}
engines: {node: '>= 10'}
cpu: [arm64]
os: [darwin]
'@tauri-apps/cli-darwin-x64@1.5.14':
resolution: {integrity: sha512-EXSwN1n5spfG8FoXuyc90ACtmDJXzaZ1gxyENaq9xEpQoo7j/Q1vb6qXxmr6azKr8zmqY4h08ZFbv3exh93xJg==}
engines: {node: '>= 10'}
cpu: [x64]
os: [darwin]
'@tauri-apps/cli-linux-arm-gnueabihf@1.5.14':
resolution: {integrity: sha512-Yb8BH/KYR7Tl+de40sZPfrqbhcU3Jlu+UPIrnXt05sjn48xqIps74Xjz8zzVp0TuHxUp8FmIGtCVhQgsbrsvvg==}
engines: {node: '>= 10'}
cpu: [arm]
os: [linux]
'@tauri-apps/cli-linux-arm64-gnu@1.5.14':
resolution: {integrity: sha512-QrKHP4gRaHiup478rPBZ+BmNd88yze9jMmheoNy9mN1K/aECRmTHO+tWhsxv5moFHZzRhO0QDWxxvTtiaPXaGg==}
engines: {node: '>= 10'}
cpu: [arm64]
os: [linux]
libc: [glibc]
'@tauri-apps/cli-linux-arm64-musl@1.5.14':
resolution: {integrity: sha512-Hb1C1VMxmUcyGjW/K/INKF87zzzgLEVRmWZZnQd7M1P4uue4xPyIwUELSdX12Z2jREPgmLW4AXPD0m6wsNu7iw==}
engines: {node: '>= 10'}
cpu: [arm64]
os: [linux]
libc: [musl]
'@tauri-apps/cli-linux-x64-gnu@1.5.14':
resolution: {integrity: sha512-kD9v/UwPDuhIgq2TJj/s2/7rqk+vmExVV6xHPKI8vVbIvlNAOZqmx3fpxjej1241vhJ/piGd/m6q6YMWGsL0oQ==}
engines: {node: '>= 10'}
cpu: [x64]
os: [linux]
libc: [glibc]
'@tauri-apps/cli-linux-x64-musl@1.5.14':
resolution: {integrity: sha512-204Drgg9Zx0+THKndqASz4+iPCwqA3gQVF9C0CDIArNXrjPyJjVvW8VP5CHiZYaTNWxlz/ltyxluM6UFWbXNFw==}
engines: {node: '>= 10'}
cpu: [x64]
os: [linux]
libc: [musl]
'@tauri-apps/cli-win32-arm64-msvc@1.5.14':
resolution: {integrity: sha512-sqPSni2MnWNCm+8YZnLdWCclxfSHaYqKuPFSz8q7Tn1G1m/cA9gyPoC1G0esHftY7bu/ZM5lB4kM3I4U0KlLiA==}
engines: {node: '>= 10'}
cpu: [arm64]
os: [win32]
'@tauri-apps/cli-win32-ia32-msvc@1.5.14':
resolution: {integrity: sha512-8xN8W0zTs8oFsQmvYLxHFeqhzVI7oTaPK1xQMc5gbpFP45jN41c21aCXfjnvzT+h90EfCHUF9EWj2HTEJSb7Iw==}
engines: {node: '>= 10'}
cpu: [ia32]
os: [win32]
'@tauri-apps/cli-win32-x64-msvc@1.5.14':
resolution: {integrity: sha512-U0slee5tNM2PYECBpPHavLSwkT3szGMZ+qhcikQQbDan84bQdLn/kHWjyXOgLJs4KSve4+KxcrN+AVqj0VyHnw==}
engines: {node: '>= 10'}
cpu: [x64]
os: [win32]
'@tauri-apps/cli@1.5.14':
resolution: {integrity: sha512-JOSMKymlg116UdEXSj69eg5p1OtZnQkUE0qIGbtNDO1sk3X/KgBN6+oHBW0BzPStp/W0AjBgrMWCqjHPwEpOug==}
engines: {node: '>= 10'}
hasBin: true
'@tootallnate/once@2.0.0': '@tootallnate/once@2.0.0':
resolution: {integrity: sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==} resolution: {integrity: sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==}
engines: {node: '>= 10'} engines: {node: '>= 10'}
@@ -1500,8 +1572,8 @@ packages:
can-use-dom@0.1.0: can-use-dom@0.1.0:
resolution: {integrity: sha512-ceOhN1DL7Y4O6M0j9ICgmTYziV89WMd96SvSl0REd8PMgrY0B/WBOPoed5S1KUmJqXgUXh8gzSe6E3ae27upsQ==} resolution: {integrity: sha512-ceOhN1DL7Y4O6M0j9ICgmTYziV89WMd96SvSl0REd8PMgrY0B/WBOPoed5S1KUmJqXgUXh8gzSe6E3ae27upsQ==}
caniuse-lite@1.0.30001628: caniuse-lite@1.0.30001629:
resolution: {integrity: sha512-S3BnR4Kh26TBxbi5t5kpbcUlLJb9lhtDXISDPwOfI+JoC+ik0QksvkZtUVyikw3hjnkgkMPSJ8oIM9yMm9vflA==} resolution: {integrity: sha512-c3dl911slnQhmxUIT4HhYzT7wnBK/XYpGnYLOj4nJBaRiw52Ibe7YxlDaAeRECvA786zCuExhxIUJ2K7nHMrBw==}
chalk@1.1.3: chalk@1.1.3:
resolution: {integrity: sha512-U3lRVLMSlsCfjqYPbLyVv11M9CPW4I728d6TCKMAOJueEeB9/8o+eSsMnxPJD+Q+K909sdESg7C+tIkoH6on1A==} resolution: {integrity: sha512-U3lRVLMSlsCfjqYPbLyVv11M9CPW4I728d6TCKMAOJueEeB9/8o+eSsMnxPJD+Q+K909sdESg7C+tIkoH6on1A==}
@@ -1897,8 +1969,8 @@ packages:
echarts@5.5.0: echarts@5.5.0:
resolution: {integrity: sha512-rNYnNCzqDAPCr4m/fqyUFv7fD9qIsd50S6GDFgO1DxZhncCsNsG7IfUlAlvZe5oSEQxtsjnHiUuppzccry93Xw==} resolution: {integrity: sha512-rNYnNCzqDAPCr4m/fqyUFv7fD9qIsd50S6GDFgO1DxZhncCsNsG7IfUlAlvZe5oSEQxtsjnHiUuppzccry93Xw==}
electron-to-chromium@1.4.790: electron-to-chromium@1.4.794:
resolution: {integrity: sha512-eVGeQxpaBYbomDBa/Mehrs28MdvCXfJmEFzaMFsv8jH/MJDLIylJN81eTJ5kvx7B7p18OiPK0BkC06lydEy63A==} resolution: {integrity: sha512-6FApLtsYhDCY0Vglq3AptsdxQ+PJLc6AxlAM0HjEihUAiOPPbkASEsq9gtxUeZY9o0sJIEa3WnF0vVH4VT4iug==}
emoji-regex@10.3.0: emoji-regex@10.3.0:
resolution: {integrity: sha512-QpLs9D9v9kArv4lfDEgg1X/gN5XLnf/A6l9cs8SPZLRZR3ZkY9+kwIQTxm+fsSej5UMYGE8fdoaZVIBlqG0XTw==} resolution: {integrity: sha512-QpLs9D9v9kArv4lfDEgg1X/gN5XLnf/A6l9cs8SPZLRZR3ZkY9+kwIQTxm+fsSej5UMYGE8fdoaZVIBlqG0XTw==}
@@ -2010,8 +2082,8 @@ packages:
eslint-parser-plain@0.1.0: eslint-parser-plain@0.1.0:
resolution: {integrity: sha512-oOeA6FWU0UJT/Rxc3XF5Cq0nbIZbylm7j8+plqq0CZoE6m4u32OXJrR+9iy4srGMmF6v6pmgvP1zPxSRIGh3sg==} resolution: {integrity: sha512-oOeA6FWU0UJT/Rxc3XF5Cq0nbIZbylm7j8+plqq0CZoE6m4u32OXJrR+9iy4srGMmF6v6pmgvP1zPxSRIGh3sg==}
eslint-plugin-es-x@7.6.0: eslint-plugin-es-x@7.7.0:
resolution: {integrity: sha512-I0AmeNgevgaTR7y2lrVCJmGYF0rjoznpDvqV/kIkZSZbZ8Rw3eu4cGlvBBULScfkSOCzqKbff5LR4CNrV7mZHA==} resolution: {integrity: sha512-aP3qj8BwiEDPttxQkZdI221DLKq9sI/qHolE2YSQL1/9+xk7dTV+tB1Fz8/IaCA+lnLA1bDEnvaS2LKs0k2Uig==}
engines: {node: ^14.18.0 || >=16.0.0} engines: {node: ^14.18.0 || >=16.0.0}
peerDependencies: peerDependencies:
eslint: '>=8' eslint: '>=8'
@@ -2129,6 +2201,10 @@ packages:
resolution: {integrity: sha512-lSgHc4Elo2m6bUDhc3Hl/VxvUDJdQWI40RZ4KMY9bKRc+hgMOT7II/JjbNDhI8VnMtrCb7U/fhpJIkLORZozWw==} resolution: {integrity: sha512-lSgHc4Elo2m6bUDhc3Hl/VxvUDJdQWI40RZ4KMY9bKRc+hgMOT7II/JjbNDhI8VnMtrCb7U/fhpJIkLORZozWw==}
engines: {node: '>=18'} engines: {node: '>=18'}
execa@9.2.0:
resolution: {integrity: sha512-vpOyYg7UAVKLAWWtRS2gAdgkT7oJbCn0me3gmUmxZih4kd3MF/oo8kNTBTIbkO3yuuF5uB4ZCZfn8BOolITYhg==}
engines: {node: ^18.19.0 || >=20.5.0}
expand-brackets@2.1.4: expand-brackets@2.1.4:
resolution: {integrity: sha512-w/ozOKR9Obk3qoWeY/WDi6MFta9AoMR+zud60mdnbniMcBxRuFJyDt2LdX/14A1UABeqk+Uk+LDfUpvoGKppZA==} resolution: {integrity: sha512-w/ozOKR9Obk3qoWeY/WDi6MFta9AoMR+zud60mdnbniMcBxRuFJyDt2LdX/14A1UABeqk+Uk+LDfUpvoGKppZA==}
engines: {node: '>=0.10.0'} engines: {node: '>=0.10.0'}
@@ -2816,8 +2892,8 @@ packages:
resolution: {integrity: sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg==} resolution: {integrity: sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg==}
engines: {node: '>=0.10.0'} engines: {node: '>=0.10.0'}
jackspeak@3.3.0: jackspeak@3.4.0:
resolution: {integrity: sha512-glPiBfKguqA7v8JsXO3iLjJWZ9FV1vNpoI0I9hI9Mnk5yetO9uPLSpiCEmiVijAssv2f54HpvtzvAHfhPieiDQ==} resolution: {integrity: sha512-JVYhQnN59LVPFCEcVa2C3CrEKYacvjRfqIQl+h8oi91aLYQVWRYbxjPcv1bUiUy/kLmQaANrYfNMCO3kuEDHfw==}
engines: {node: '>=14'} engines: {node: '>=14'}
jiti@1.21.3: jiti@1.21.3:
@@ -4226,8 +4302,8 @@ packages:
tslib@2.6.3: tslib@2.6.3:
resolution: {integrity: sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ==} resolution: {integrity: sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ==}
tsx@4.11.2: tsx@4.12.0:
resolution: {integrity: sha512-V5DL5v1BuItjsQ2FN9+4OjR7n5cr8hSgN+VGmm/fd2/0cgQdBIWHcQ3bFYm/5ZTmyxkTDBUIaRuW2divgfPe0A==} resolution: {integrity: sha512-642NAWAbDqPZINjmL32Lh/B+pd8vbVj6LHPsWm09IIHqQuWhCrNfcPTjRlHFWvv3FfM4vt9NLReBIjUNj5ZhDg==}
engines: {node: '>=18.0.0'} engines: {node: '>=18.0.0'}
hasBin: true hasBin: true
@@ -5058,7 +5134,7 @@ snapshots:
'@humanwhocodes/retry@0.3.0': {} '@humanwhocodes/retry@0.3.0': {}
'@iconify/json@2.2.216': '@iconify/json@2.2.217':
dependencies: dependencies:
'@iconify/types': 2.0.0 '@iconify/types': 2.0.0
pathe: 1.1.2 pathe: 1.1.2
@@ -5355,6 +5431,49 @@ snapshots:
dependencies: dependencies:
defer-to-connect: 2.0.1 defer-to-connect: 2.0.1
'@tauri-apps/cli-darwin-arm64@1.5.14':
optional: true
'@tauri-apps/cli-darwin-x64@1.5.14':
optional: true
'@tauri-apps/cli-linux-arm-gnueabihf@1.5.14':
optional: true
'@tauri-apps/cli-linux-arm64-gnu@1.5.14':
optional: true
'@tauri-apps/cli-linux-arm64-musl@1.5.14':
optional: true
'@tauri-apps/cli-linux-x64-gnu@1.5.14':
optional: true
'@tauri-apps/cli-linux-x64-musl@1.5.14':
optional: true
'@tauri-apps/cli-win32-arm64-msvc@1.5.14':
optional: true
'@tauri-apps/cli-win32-ia32-msvc@1.5.14':
optional: true
'@tauri-apps/cli-win32-x64-msvc@1.5.14':
optional: true
'@tauri-apps/cli@1.5.14':
optionalDependencies:
'@tauri-apps/cli-darwin-arm64': 1.5.14
'@tauri-apps/cli-darwin-x64': 1.5.14
'@tauri-apps/cli-linux-arm-gnueabihf': 1.5.14
'@tauri-apps/cli-linux-arm64-gnu': 1.5.14
'@tauri-apps/cli-linux-arm64-musl': 1.5.14
'@tauri-apps/cli-linux-x64-gnu': 1.5.14
'@tauri-apps/cli-linux-x64-musl': 1.5.14
'@tauri-apps/cli-win32-arm64-msvc': 1.5.14
'@tauri-apps/cli-win32-ia32-msvc': 1.5.14
'@tauri-apps/cli-win32-x64-msvc': 1.5.14
'@tootallnate/once@2.0.0': {} '@tootallnate/once@2.0.0': {}
'@trysound/sax@0.2.0': {} '@trysound/sax@0.2.0': {}
@@ -5949,8 +6068,8 @@ snapshots:
browserslist@4.23.0: browserslist@4.23.0:
dependencies: dependencies:
caniuse-lite: 1.0.30001628 caniuse-lite: 1.0.30001629
electron-to-chromium: 1.4.790 electron-to-chromium: 1.4.794
node-releases: 2.0.14 node-releases: 2.0.14
update-browserslist-db: 1.0.16(browserslist@4.23.0) update-browserslist-db: 1.0.16(browserslist@4.23.0)
@@ -6070,7 +6189,7 @@ snapshots:
can-use-dom@0.1.0: {} can-use-dom@0.1.0: {}
caniuse-lite@1.0.30001628: {} caniuse-lite@1.0.30001629: {}
chalk@1.1.3: chalk@1.1.3:
dependencies: dependencies:
@@ -6452,7 +6571,7 @@ snapshots:
tslib: 2.3.0 tslib: 2.3.0
zrender: 5.5.0 zrender: 5.5.0
electron-to-chromium@1.4.790: {} electron-to-chromium@1.4.794: {}
emoji-regex@10.3.0: {} emoji-regex@10.3.0: {}
@@ -6617,7 +6736,7 @@ snapshots:
eslint-parser-plain@0.1.0: {} eslint-parser-plain@0.1.0: {}
eslint-plugin-es-x@7.6.0(eslint@9.4.0): eslint-plugin-es-x@7.7.0(eslint@9.4.0):
dependencies: dependencies:
'@eslint-community/eslint-utils': 4.4.0(eslint@9.4.0) '@eslint-community/eslint-utils': 4.4.0(eslint@9.4.0)
'@eslint-community/regexpp': 4.10.1 '@eslint-community/regexpp': 4.10.1
@@ -6645,7 +6764,7 @@ snapshots:
'@eslint-community/eslint-utils': 4.4.0(eslint@9.4.0) '@eslint-community/eslint-utils': 4.4.0(eslint@9.4.0)
enhanced-resolve: 5.17.0 enhanced-resolve: 5.17.0
eslint: 9.4.0 eslint: 9.4.0
eslint-plugin-es-x: 7.6.0(eslint@9.4.0) eslint-plugin-es-x: 7.7.0(eslint@9.4.0)
get-tsconfig: 4.7.5 get-tsconfig: 4.7.5
globals: 15.3.0 globals: 15.3.0
ignore: 5.3.1 ignore: 5.3.1
@@ -6823,6 +6942,21 @@ snapshots:
strip-final-newline: 4.0.0 strip-final-newline: 4.0.0
yoctocolors: 2.0.2 yoctocolors: 2.0.2
execa@9.2.0:
dependencies:
'@sindresorhus/merge-streams': 4.0.0
cross-spawn: 7.0.3
figures: 6.1.0
get-stream: 9.0.1
human-signals: 7.0.0
is-plain-obj: 4.1.0
is-stream: 4.0.1
npm-run-path: 5.3.0
pretty-ms: 9.0.0
signal-exit: 4.1.0
strip-final-newline: 4.0.0
yoctocolors: 2.0.2
expand-brackets@2.1.4: expand-brackets@2.1.4:
dependencies: dependencies:
debug: 2.6.9 debug: 2.6.9
@@ -7050,7 +7184,7 @@ snapshots:
glob@10.4.1: glob@10.4.1:
dependencies: dependencies:
foreground-child: 3.1.1 foreground-child: 3.1.1
jackspeak: 3.3.0 jackspeak: 3.4.0
minimatch: 9.0.4 minimatch: 9.0.4
minipass: 7.1.2 minipass: 7.1.2
path-scurry: 1.11.1 path-scurry: 1.11.1
@@ -7482,7 +7616,7 @@ snapshots:
isobject@3.0.1: {} isobject@3.0.1: {}
jackspeak@3.3.0: jackspeak@3.4.0:
dependencies: dependencies:
'@isaacs/cliui': 8.0.2 '@isaacs/cliui': 8.0.2
optionalDependencies: optionalDependencies:
@@ -9127,7 +9261,7 @@ snapshots:
tslib@2.6.3: {} tslib@2.6.3: {}
tsx@4.11.2: tsx@4.12.0:
dependencies: dependencies:
esbuild: 0.20.2 esbuild: 0.20.2
get-tsconfig: 4.7.5 get-tsconfig: 4.7.5

BIN
public/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

3
src-tauri/.gitignore vendored Normal file
View File

@@ -0,0 +1,3 @@
# Generated by Cargo
# will have compiled files and executables
/target/

3664
src-tauri/Cargo.lock generated Normal file

File diff suppressed because it is too large Load Diff

26
src-tauri/Cargo.toml Normal file
View 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
View File

@@ -0,0 +1,3 @@
fn main() {
tauri_build::build()
}

BIN
src-tauri/icons/128x128.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

BIN
src-tauri/icons/32x32.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

BIN
src-tauri/icons/icon.icns Normal file

Binary file not shown.

BIN
src-tauri/icons/icon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

BIN
src-tauri/icons/icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

8
src-tauri/src/main.rs Normal file
View 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
View 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
}
]
}
}

View File

@@ -41,6 +41,7 @@ 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"

View File

@@ -1,5 +1,6 @@
<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';
@@ -24,6 +25,12 @@ 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>
@@ -32,6 +39,7 @@ const transitionName = computed(() => (themeStore.page.animate ? themeStore.page
: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">

View File

@@ -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',

View File

@@ -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: '操作',

View File

@@ -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
View 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 (!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;
}

View File

@@ -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';

View File

@@ -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();

View File

@@ -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
}; };
}); });

View File

@@ -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');
} }

View File

@@ -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;

View File

@@ -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 */

View File

@@ -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();

View File

@@ -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)
}, },