Compare commits

..

1 Commits

Author SHA1 Message Date
Soybean
f6c97f403f chore(release): release tauri v1.3.9 2024-11-17 22:47:54 +08:00
35 changed files with 2790 additions and 9294 deletions

View File

@@ -1,70 +1,6 @@
# Changelog # Changelog
## [v1.3.11](https://github.com/soybeanjs/soybean-admin/compare/v1.3.10...v1.3.11) (2025-01-19)
###    🚀 Features
- **projects**: multi language buttons support hiding. &nbsp;-&nbsp; by @Azir-11 in https://github.com/soybeanjs/soybean-admin/issues/683 [<samp>(d7aeb)</samp>](https://github.com/soybeanjs/soybean-admin/commit/d7aebb7)
### &nbsp;&nbsp;&nbsp;🐞 Bug Fixes
- **hooks**:
- The total number before assigning a value to the table is incorrect. &nbsp;-&nbsp; by @Azir-11 in https://github.com/soybeanjs/soybean-admin/issues/687 [<samp>(56760)</samp>](https://github.com/soybeanjs/soybean-admin/commit/5676024)
- **projects**:
- fix login success notification. fixed #688 &nbsp;-&nbsp; by @soybeanjs in https://github.com/soybeanjs/soybean-admin/issues/688 [<samp>(60dd2)</samp>](https://github.com/soybeanjs/soybean-admin/commit/60dd226)
- fix update notifications. fixed #691, fixed #692 &nbsp;-&nbsp; by @soybeanjs in https://github.com/soybeanjs/soybean-admin/issues/691 and https://github.com/soybeanjs/soybean-admin/issues/692 [<samp>(ac862)</samp>](https://github.com/soybeanjs/soybean-admin/commit/ac86247)
### &nbsp;&nbsp;&nbsp;🛠 Optimizations
- **projects**: optimize code &nbsp;-&nbsp; by @soybeanjs [<samp>(6489e)</samp>](https://github.com/soybeanjs/soybean-admin/commit/6489ec4)
### &nbsp;&nbsp;&nbsp;📖 Documentation
- **projects**: update README &nbsp;-&nbsp; by @soybeanjs [<samp>(21434)</samp>](https://github.com/soybeanjs/soybean-admin/commit/214341e)
### &nbsp;&nbsp;&nbsp;🏡 Chore
- **deps**: update deps &nbsp;-&nbsp; by @soybeanjs [<samp>(c9433)</samp>](https://github.com/soybeanjs/soybean-admin/commit/c9433e1)
### &nbsp;&nbsp;&nbsp;❤️ Contributors
[![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;
## [v1.3.10](https://github.com/honghuangdc/soybean-admin/compare/v1.3.9...v1.3.10) (2024-12-16)
### &nbsp;&nbsp;&nbsp;🚀 Features
- **projects**: support show tab when not loggedIn &nbsp;-&nbsp; by @soybeanjs [<samp>(ba381)</samp>](https://github.com/honghuangdc/soybean-admin/commit/ba38119)
### &nbsp;&nbsp;&nbsp;🐞 Bug Fixes
- **deps**:
- reduced eslint version to 9.14.0 &nbsp;-&nbsp; by @soybeanjs [<samp>(af417)</samp>](https://github.com/honghuangdc/soybean-admin/commit/af4177e)
- **projects**:
- fix route guard hook `onRouteSwitchWhenLoggedIn`. fixed #680 &nbsp;-&nbsp; by @soybeanjs in https://github.com/honghuangdc/soybean-admin/issues/680 [<samp>(ab985)</samp>](https://github.com/honghuangdc/soybean-admin/commit/ab9858c)
- check if init userInfo when initAuthRoute. fixed #680 &nbsp;-&nbsp; by @soybeanjs in https://github.com/honghuangdc/soybean-admin/issues/680 [<samp>(9f4fb)</samp>](https://github.com/honghuangdc/soybean-admin/commit/9f4fb8c)
### &nbsp;&nbsp;&nbsp;🛠 Optimizations
- **projects**:
- optimize router guard &nbsp;-&nbsp; by @soybeanjs [<samp>(0dfcf)</samp>](https://github.com/honghuangdc/soybean-admin/commit/0dfcf18)
- use `defu` to fill added theme config &nbsp;-&nbsp; by @soybeanjs [<samp>(101b6)</samp>](https://github.com/honghuangdc/soybean-admin/commit/101b6f9)
### &nbsp;&nbsp;&nbsp;📖 Documentation
- **projects**: ✏️ add element-plus version link &nbsp;-&nbsp; by **一寸灰** in https://github.com/honghuangdc/soybean-admin/issues/679 [<samp>(5c6ab)</samp>](https://github.com/honghuangdc/soybean-admin/commit/5c6ab0b)
### &nbsp;&nbsp;&nbsp;🏡 Chore
- rename env.d.ts to vite-env.d.ts &nbsp;-&nbsp; by @wzc520pyfm in https://github.com/honghuangdc/soybean-admin/issues/675 [<samp>(b93c2)</samp>](https://github.com/honghuangdc/soybean-admin/commit/b93c203)
- **projects**: update deps & fix vite config &nbsp;-&nbsp; by @soybeanjs [<samp>(3e0eb)</samp>](https://github.com/honghuangdc/soybean-admin/commit/3e0eb72)
### &nbsp;&nbsp;&nbsp;❤️ Contributors
[![soybeanjs](https://github.com/soybeanjs.png?size=48)](https://github.com/soybeanjs)&nbsp;&nbsp;[![wzc520pyfm](https://github.com/wzc520pyfm.png?size=48)](https://github.com/wzc520pyfm)&nbsp;&nbsp;
[一寸灰](mailto:webzhangfei@163.com),&nbsp;
## [v1.3.9](https://github.com/soybeanjs/soybean-admin/compare/v1.3.8...v1.3.9) (2024-11-17) ## [v1.3.9](https://github.com/soybeanjs/soybean-admin/compare/v1.3.8...v1.3.9) (2024-11-17)
### &nbsp;&nbsp;&nbsp;🚀 Features ### &nbsp;&nbsp;&nbsp;🚀 Features

View File

@@ -49,10 +49,6 @@
- [Github Repository](https://github.com/soybeanjs/soybean-admin-antd) - [Github Repository](https://github.com/soybeanjs/soybean-admin-antd)
- [Gitee Repository](https://gitee.com/honghuangdc/soybean-admin-antd) - [Gitee Repository](https://gitee.com/honghuangdc/soybean-admin-antd)
- **ElementPlus Version:**
- [Preview Link](https://elp.soybeanjs.cn/)
- [Github Repository](https://github.com/soybeanjs/soybean-admin-element-plus)
- **Legacy Version:** - **Legacy Version:**
- [Preview Link](https://legacy.soybeanjs.cn/) - [Preview Link](https://legacy.soybeanjs.cn/)
- [Github Repository](https://github.com/soybeanjs/soybean-admin/tree/legacy) - [Github Repository](https://github.com/soybeanjs/soybean-admin/tree/legacy)
@@ -113,10 +109,6 @@ pnpm dev
pnpm build pnpm build
``` ```
**Code Synchronization**
Refer to the [Code Synchronization](https://docs.soybeanjs.cn/guide/sync) document.
## Ecosystem ## Ecosystem
- [react-soybean-admin](https://github.com/mufeng889/react-soybean-admin): SoybeanAdmin based version of React. - [react-soybean-admin](https://github.com/mufeng889/react-soybean-admin): SoybeanAdmin based version of React.

View File

@@ -41,13 +41,12 @@
- [预览地址](https://naive.soybeanjs.cn/) - [预览地址](https://naive.soybeanjs.cn/)
- [Github 仓库](https://github.com/soybeanjs/soybean-admin) - [Github 仓库](https://github.com/soybeanjs/soybean-admin)
- [Gitee 仓库](https://gitee.com/honghuangdc/soybean-admin) - [Gitee 仓库](https://gitee.com/honghuangdc/soybean-admin)
- **AntDesignVue 版本:** - **AntDesignVue 版本:**
- [预览地址](https://antd.soybeanjs.cn/) - [预览地址](https://antd.soybeanjs.cn/)
- [Github 仓库](https://github.com/soybeanjs/soybean-admin-antd) - [Github 仓库](https://github.com/soybeanjs/soybean-admin-antd)
- [Gitee 仓库](https://gitee.com/honghuangdc/soybean-admin-antd) - [Gitee 仓库](https://gitee.com/honghuangdc/soybean-admin-antd)
- **ElementPlus 版本:**
- [预览地址](https://elp.soybeanjs.cn/)
- [Github 仓库](https://github.com/soybeanjs/soybean-admin-element-plus)
- **旧版:** - **旧版:**
- [预览地址](https://legacy.soybeanjs.cn/) - [预览地址](https://legacy.soybeanjs.cn/)
- [Github 仓库](https://github.com/soybeanjs/soybean-admin/tree/legacy) - [Github 仓库](https://github.com/soybeanjs/soybean-admin/tree/legacy)
@@ -138,10 +137,6 @@ pnpm dev
pnpm build pnpm build
``` ```
**代码同步**
参考 [代码同步](https://docs.soybeanjs.cn/zh/guide/sync) 文档。
## 周边生态 ## 周边生态
- [react-soybean-admin](https://github.com/mufeng889/react-soybean-admin): 基于SoybeanAdmin的React版本. - [react-soybean-admin](https://github.com/mufeng889/react-soybean-admin): 基于SoybeanAdmin的React版本.

View File

@@ -1,7 +1,7 @@
{ {
"name": "soybean-admin", "name": "soybean-admin",
"type": "module", "type": "module",
"version": "1.3.11", "version": "1.3.9",
"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",
@@ -51,60 +51,58 @@
}, },
"dependencies": { "dependencies": {
"@better-scroll/core": "2.5.1", "@better-scroll/core": "2.5.1",
"@iconify/vue": "4.3.0", "@iconify/vue": "4.1.2",
"@sa/axios": "workspace:*", "@sa/axios": "workspace:*",
"@sa/color": "workspace:*", "@sa/color": "workspace:*",
"@sa/hooks": "workspace:*", "@sa/hooks": "workspace:*",
"@sa/materials": "workspace:*", "@sa/materials": "workspace:*",
"@sa/utils": "workspace:*", "@sa/utils": "workspace:*",
"@tauri-apps/api": "2.2.0", "@vueuse/core": "11.2.0",
"@vueuse/core": "12.4.0",
"clipboard": "2.0.11", "clipboard": "2.0.11",
"dayjs": "1.11.13", "dayjs": "1.11.13",
"defu": "6.1.4", "echarts": "5.5.1",
"echarts": "5.6.0",
"json5": "2.2.3", "json5": "2.2.3",
"naive-ui": "2.41.0", "naive-ui": "2.40.1",
"nprogress": "0.2.0", "nprogress": "0.2.0",
"pinia": "2.3.0", "pinia": "2.2.6",
"tailwind-merge": "2.6.0", "tailwind-merge": "2.5.4",
"vue": "3.5.13", "vue": "3.5.13",
"vue-draggable-plus": "0.6.0", "vue-draggable-plus": "0.6.0",
"vue-i18n": "11.0.1", "vue-i18n": "10.0.4",
"vue-router": "4.5.0" "vue-router": "4.4.5"
}, },
"devDependencies": { "devDependencies": {
"@elegant-router/vue": "0.3.8", "@elegant-router/vue": "0.3.8",
"@iconify/json": "2.2.297", "@iconify/json": "2.2.273",
"@sa/scripts": "workspace:*", "@sa/scripts": "workspace:*",
"@sa/uno-preset": "workspace:*", "@sa/uno-preset": "workspace:*",
"@soybeanjs/eslint-config": "1.4.4", "@soybeanjs/eslint-config": "1.4.2",
"@tauri-apps/cli": "2.2.5", "@tauri-apps/cli": "2.1.0",
"@types/node": "22.10.7", "@types/node": "22.9.0",
"@types/nprogress": "0.2.3", "@types/nprogress": "0.2.3",
"@unocss/eslint-config": "65.4.2", "@unocss/eslint-config": "0.64.1",
"@unocss/preset-icons": "65.4.2", "@unocss/preset-icons": "0.64.1",
"@unocss/preset-uno": "65.4.2", "@unocss/preset-uno": "0.64.1",
"@unocss/transformer-directives": "65.4.2", "@unocss/transformer-directives": "0.64.1",
"@unocss/transformer-variant-group": "65.4.2", "@unocss/transformer-variant-group": "0.64.1",
"@unocss/vite": "65.4.2", "@unocss/vite": "0.64.1",
"@vitejs/plugin-vue": "5.2.1", "@vitejs/plugin-vue": "5.2.0",
"@vitejs/plugin-vue-jsx": "4.1.1", "@vitejs/plugin-vue-jsx": "4.1.0",
"eslint": "9.18.0", "eslint": "9.14.0",
"eslint-plugin-vue": "9.32.0", "eslint-plugin-vue": "9.31.0",
"lint-staged": "15.4.1", "lint-staged": "15.2.10",
"sass": "1.83.4", "sass": "1.81.0",
"simple-git-hooks": "2.11.1", "simple-git-hooks": "2.11.1",
"tsx": "4.19.2", "tsx": "4.19.2",
"typescript": "5.7.3", "typescript": "5.6.3",
"unplugin-icons": "22.0.0", "unplugin-icons": "0.20.1",
"unplugin-vue-components": "28.0.0", "unplugin-vue-components": "0.27.4",
"vite": "6.0.7", "vite": "5.4.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.7.0", "vite-plugin-vue-devtools": "7.6.4",
"vue-eslint-parser": "9.4.3", "vue-eslint-parser": "9.4.3",
"vue-tsc": "2.2.0" "vue-tsc": "2.1.10"
}, },
"simple-git-hooks": { "simple-git-hooks": {
"commit-msg": "pnpm sa git-commit-verify", "commit-msg": "pnpm sa git-commit-verify",

View File

@@ -1,6 +1,6 @@
{ {
"name": "@sa/alova", "name": "@sa/alova",
"version": "1.3.11", "version": "1.3.9",
"exports": { "exports": {
".": "./src/index.ts", ".": "./src/index.ts",
"./fetch": "./src/fetch.ts", "./fetch": "./src/fetch.ts",
@@ -13,8 +13,8 @@
} }
}, },
"dependencies": { "dependencies": {
"@alova/mock": "2.0.11", "@alova/mock": "2.0.9",
"@sa/utils": "workspace:*", "@sa/utils": "workspace:*",
"alova": "3.2.8" "alova": "3.2.3"
} }
} }

View File

@@ -1,6 +1,6 @@
{ {
"name": "@sa/axios", "name": "@sa/axios",
"version": "1.3.11", "version": "1.3.9",
"exports": { "exports": {
".": "./src/index.ts" ".": "./src/index.ts"
}, },
@@ -11,11 +11,11 @@
}, },
"dependencies": { "dependencies": {
"@sa/utils": "workspace:*", "@sa/utils": "workspace:*",
"axios": "1.7.9", "axios": "1.7.7",
"axios-retry": "4.5.0", "axios-retry": "4.5.0",
"qs": "6.14.0" "qs": "6.13.0"
}, },
"devDependencies": { "devDependencies": {
"@types/qs": "6.9.18" "@types/qs": "6.9.17"
} }
} }

View File

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

View File

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

View File

@@ -1,6 +1,6 @@
{ {
"name": "@sa/materials", "name": "@sa/materials",
"version": "1.3.11", "version": "1.3.9",
"exports": { "exports": {
".": "./src/index.ts" ".": "./src/index.ts"
}, },
@@ -11,7 +11,7 @@
}, },
"dependencies": { "dependencies": {
"@sa/utils": "workspace:*", "@sa/utils": "workspace:*",
"simplebar-vue": "2.4.0" "simplebar-vue": "2.3.5"
}, },
"devDependencies": { "devDependencies": {
"typed-css-modules": "0.9.1" "typed-css-modules": "0.9.1"

View File

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

View File

@@ -1,6 +1,6 @@
{ {
"name": "@sa/scripts", "name": "@sa/scripts",
"version": "1.3.11", "version": "1.3.9",
"bin": { "bin": {
"sa": "./bin.ts" "sa": "./bin.ts"
}, },
@@ -14,14 +14,14 @@
}, },
"devDependencies": { "devDependencies": {
"@soybeanjs/changelog": "0.3.24", "@soybeanjs/changelog": "0.3.24",
"bumpp": "9.10.1", "bumpp": "9.8.1",
"c12": "2.0.1", "c12": "2.0.1",
"cac": "6.7.14", "cac": "6.7.14",
"consola": "3.4.0", "consola": "3.2.3",
"enquirer": "2.4.1", "enquirer": "2.4.1",
"execa": "9.5.2", "execa": "9.5.1",
"kolorist": "1.8.0", "kolorist": "1.8.0",
"npm-check-updates": "17.1.14", "npm-check-updates": "17.1.11",
"rimraf": "6.0.1" "rimraf": "6.0.1"
} }
} }

View File

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

View File

@@ -1,6 +1,6 @@
{ {
"name": "@sa/utils", "name": "@sa/utils",
"version": "1.3.11", "version": "1.3.9",
"exports": { "exports": {
".": "./src/index.ts" ".": "./src/index.ts"
}, },
@@ -14,7 +14,7 @@
"crypto-js": "4.2.0", "crypto-js": "4.2.0",
"klona": "2.0.6", "klona": "2.0.6",
"localforage": "1.10.0", "localforage": "1.10.0",
"nanoid": "5.0.9" "nanoid": "5.0.8"
}, },
"devDependencies": { "devDependencies": {
"@types/crypto-js": "4.2.2" "@types/crypto-js": "4.2.2"

3631
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

2916
src-tauri/Cargo.lock generated

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,9 +0,0 @@
{
"migrated": {
"identifier": "migrated",
"description": "permissions that were migrated from v1",
"local": true,
"windows": ["main"],
"permissions": ["core:default"]
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -25,7 +25,7 @@ const naiveDateLocale = computed(() => {
const watermarkProps = computed<WatermarkProps>(() => { const watermarkProps = computed<WatermarkProps>(() => {
return { return {
content: themeStore.watermark.text, content: themeStore.watermark?.text || 'SoybeanAdmin',
cross: true, cross: true,
fullscreen: true, fullscreen: true,
fontSize: 16, fontSize: 16,
@@ -50,7 +50,7 @@ const watermarkProps = computed<WatermarkProps>(() => {
> >
<AppProvider> <AppProvider>
<RouterView class="bg-layout" /> <RouterView class="bg-layout" />
<NWatermark v-if="themeStore.watermark.visible" v-bind="watermarkProps" /> <NWatermark v-if="themeStore.watermark?.visible" v-bind="watermarkProps" />
</AppProvider> </AppProvider>
</NConfigProvider> </NConfigProvider>
</template> </template>

View File

@@ -102,9 +102,9 @@ export function useRouterPush(inSetup = true) {
const redirect = route.value.query?.redirect as string; const redirect = route.value.query?.redirect as string;
if (needRedirect && redirect) { if (needRedirect && redirect) {
await routerPush(redirect); routerPush(redirect);
} else { } else {
await toHome(); toHome();
} }
} }

View File

@@ -119,7 +119,6 @@ export function useTable<A extends NaiveUI.TableApiFn>(config: NaiveUI.NaiveTabl
page: 1, page: 1,
pageSize: 10, pageSize: 10,
showSizePicker: true, showSizePicker: true,
itemCount: 0,
pageSizes: [10, 15, 20, 25, 30], pageSizes: [10, 15, 20, 25, 30],
onUpdatePage: async (page: number) => { onUpdatePage: async (page: number) => {
pagination.page = page; pagination.page = page;

View File

@@ -40,12 +40,7 @@ const { isFullscreen, toggle } = useFullscreen();
<div class="h-full flex-y-center justify-end"> <div class="h-full flex-y-center justify-end">
<GlobalSearch /> <GlobalSearch />
<FullScreen v-if="!appStore.isMobile" :full="isFullscreen" @click="toggle" /> <FullScreen v-if="!appStore.isMobile" :full="isFullscreen" @click="toggle" />
<LangSwitch <LangSwitch :lang="appStore.locale" :lang-options="appStore.localeOptions" @change-lang="appStore.changeLocale" />
v-if="themeStore.header.multilingual.visible"
:lang="appStore.locale"
:lang-options="appStore.localeOptions"
@change-lang="appStore.changeLocale"
/>
<ThemeSchemaSwitch <ThemeSchemaSwitch
:theme-schema="themeStore.themeScheme" :theme-schema="themeStore.themeScheme"
:is-dark="themeStore.darkMode" :is-dark="themeStore.darkMode"

View File

@@ -114,10 +114,10 @@ const isWrapperScrollMode = computed(() => themeStore.layout.scrollMode === 'wra
> >
<NSwitch v-model:value="themeStore.footer.right" /> <NSwitch v-model:value="themeStore.footer.right" />
</SettingItem> </SettingItem>
<SettingItem key="8" :label="$t('theme.watermark.visible')"> <SettingItem v-if="themeStore.watermark" key="8" :label="$t('theme.watermark.visible')">
<NSwitch v-model:value="themeStore.watermark.visible" /> <NSwitch v-model:value="themeStore.watermark.visible" />
</SettingItem> </SettingItem>
<SettingItem v-if="themeStore.watermark.visible" key="8-1" :label="$t('theme.watermark.text')"> <SettingItem v-if="themeStore.watermark?.visible" key="8-1" :label="$t('theme.watermark.text')">
<NInput <NInput
v-model:value="themeStore.watermark.text" v-model:value="themeStore.watermark.text"
autosize autosize
@@ -127,9 +127,6 @@ const isWrapperScrollMode = computed(() => themeStore.layout.scrollMode === 'wra
placeholder="SoybeanAdmin" placeholder="SoybeanAdmin"
/> />
</SettingItem> </SettingItem>
<SettingItem key="9" :label="$t('theme.header.multilingual.visible')">
<NSwitch v-model:value="themeStore.header.multilingual.visible" />
</SettingItem>
</TransitionGroup> </TransitionGroup>
</template> </template>

View File

@@ -109,9 +109,6 @@ const local: App.I18n.Schema = {
breadcrumb: { breadcrumb: {
visible: 'Breadcrumb Visible', visible: 'Breadcrumb Visible',
showIcon: 'Breadcrumb Icon Visible' showIcon: 'Breadcrumb Icon Visible'
},
multilingual: {
visible: 'Display multilingual button'
} }
}, },
tab: { tab: {

View File

@@ -109,9 +109,6 @@ const local: App.I18n.Schema = {
breadcrumb: { breadcrumb: {
visible: '显示面包屑', visible: '显示面包屑',
showIcon: '显示面包屑图标' showIcon: '显示面包屑图标'
},
multilingual: {
visible: '显示多语言按钮'
} }
}, },
tab: { tab: {

View File

@@ -10,18 +10,22 @@ export function setupAppErrorHandle(app: App) {
}; };
} }
export function setupAppVersionNotification() { // Update check interval in milliseconds
// Update check interval in milliseconds const UPDATE_CHECK_INTERVAL = 3 * 60 * 1000;
const UPDATE_CHECK_INTERVAL = 3 * 60 * 1000;
export function setupAppVersionNotification() {
const canAutoUpdateApp = import.meta.env.VITE_AUTOMATICALLY_DETECT_UPDATE === 'Y';
const canAutoUpdateApp = import.meta.env.VITE_AUTOMATICALLY_DETECT_UPDATE === 'Y' && import.meta.env.PROD;
if (!canAutoUpdateApp) return; if (!canAutoUpdateApp) return;
let isShow = false; let isShow = false;
let updateInterval: ReturnType<typeof setInterval> | undefined; let updateInterval: ReturnType<typeof setInterval> | undefined;
// Check if updates should be checked
const shouldCheckForUpdates = [!isShow, document.visibilityState === 'visible', !import.meta.env.DEV].every(Boolean);
const checkForUpdates = async () => { const checkForUpdates = async () => {
if (isShow) return; if (!shouldCheckForUpdates) return;
const buildTime = await getHtmlBuildTime(); const buildTime = await getHtmlBuildTime();
@@ -43,7 +47,6 @@ export function setupAppVersionNotification() {
{ {
onClick() { onClick() {
n?.destroy(); n?.destroy();
isShow = false;
} }
}, },
() => $t('system.updateCancel') () => $t('system.updateCancel')
@@ -74,7 +77,7 @@ export function setupAppVersionNotification() {
}; };
// If updates should be checked, set up the visibility change listener and start the update interval // If updates should be checked, set up the visibility change listener and start the update interval
if (!isShow && document.visibilityState === 'visible') { if (shouldCheckForUpdates) {
// Check for updates when the document is visible // Check for updates when the document is visible
document.addEventListener('visibilitychange', () => { document.addEventListener('visibilitychange', () => {
if (document.visibilityState === 'visible') { if (document.visibilityState === 'visible') {

View File

@@ -138,11 +138,11 @@ async function initRoute(to: RouteLocationNormalized): Promise<RouteLocationRaw
} }
} }
routeStore.onRouteSwitchWhenLoggedIn();
// the auth route is initialized // the auth route is initialized
// it is not the "not-found" route, then it is allowed to access // it is not the "not-found" route, then it is allowed to access
if (!isNotFoundRoute) { if (!isNotFoundRoute) {
routeStore.onRouteSwitchWhenLoggedIn();
return null; return null;
} }

View File

@@ -69,13 +69,17 @@ export const useAuthStore = defineStore(SetupStoreId.Auth, () => {
const pass = await loginByToken(loginToken); const pass = await loginByToken(loginToken);
if (pass) { if (pass) {
await routeStore.initAuthRoute();
await redirectFromLogin(redirect); await redirectFromLogin(redirect);
window.$notification?.success({ if (routeStore.isInitAuthRoute) {
title: $t('page.login.common.loginSuccess'), window.$notification?.success({
content: $t('page.login.common.welcomeBack', { userName: userInfo.userName }), title: $t('page.login.common.loginSuccess'),
duration: 4500 content: $t('page.login.common.welcomeBack', { userName: userInfo.userName }),
}); duration: 4500
});
}
} }
} else { } else {
resetStore(); resetStore();

View File

@@ -170,17 +170,10 @@ export const useRouteStore = defineStore(SetupStoreId.Route, () => {
handleConstantAndAuthRoutes(); handleConstantAndAuthRoutes();
setIsInitConstantRoute(true); setIsInitConstantRoute(true);
tabStore.initHomeTab();
} }
/** Init auth route */ /** Init auth route */
async function initAuthRoute() { async function initAuthRoute() {
// check if user info is initialized
if (!authStore.userInfo.userId) {
await authStore.initUserInfo();
}
if (authRouteMode.value === 'static') { if (authRouteMode.value === 'static') {
initStaticAuthRoute(); initStaticAuthRoute();
} else { } else {
@@ -318,7 +311,7 @@ export const useRouteStore = defineStore(SetupStoreId.Route, () => {
} }
async function onRouteSwitchWhenLoggedIn() { async function onRouteSwitchWhenLoggedIn() {
await authStore.initUserInfo(); authStore.initUserInfo();
} }
async function onRouteSwitchWhenNotLoggedIn() { async function onRouteSwitchWhenNotLoggedIn() {

View File

@@ -1,5 +1,4 @@
import type { GlobalThemeOverrides } from 'naive-ui'; import type { GlobalThemeOverrides } from 'naive-ui';
import { defu } from 'defu';
import { addColorAlpha, getColorPalette, getPaletteColorByNumber, getRgb } from '@sa/color'; import { addColorAlpha, getColorPalette, getPaletteColorByNumber, getRgb } from '@sa/color';
import { overrideThemeSettings, themeSettings } from '@/theme/settings'; import { overrideThemeSettings, themeSettings } from '@/theme/settings';
import { themeVars } from '@/theme/vars'; import { themeVars } from '@/theme/vars';
@@ -18,15 +17,12 @@ export function initThemeSettings() {
// if it is production mode, the theme settings will be cached in localStorage // if it is production mode, the theme settings will be cached in localStorage
// if want to update theme settings when publish new version, please update `overrideThemeSettings` in `src/theme/settings.ts` // if want to update theme settings when publish new version, please update `overrideThemeSettings` in `src/theme/settings.ts`
const localSettings = localStg.get('themeSettings'); const settings = localStg.get('themeSettings') || themeSettings;
let settings = defu(localSettings, themeSettings);
const isOverride = localStg.get('overrideThemeFlag') === BUILD_TIME; const isOverride = localStg.get('overrideThemeFlag') === BUILD_TIME;
if (!isOverride) { if (!isOverride) {
settings = defu(overrideThemeSettings, settings); Object.assign(settings, overrideThemeSettings);
localStg.set('overrideThemeFlag', BUILD_TIME); localStg.set('overrideThemeFlag', BUILD_TIME);
} }

View File

@@ -27,9 +27,6 @@ export const themeSettings: App.Theme.ThemeSetting = {
breadcrumb: { breadcrumb: {
visible: true, visible: true,
showIcon: true showIcon: true
},
multilingual: {
visible: true
} }
}, },
tab: { tab: {
@@ -86,4 +83,10 @@ export const themeSettings: App.Theme.ThemeSetting = {
* *
* If publish new version, use `overrideThemeSettings` to override certain theme settings * If publish new version, use `overrideThemeSettings` to override certain theme settings
*/ */
export const overrideThemeSettings: Partial<App.Theme.ThemeSetting> = {}; export const overrideThemeSettings: Partial<App.Theme.ThemeSetting> = {
resetCacheStrategy: 'close',
watermark: {
visible: false,
text: 'SoybeanAdmin'
}
};

14
src/typings/app.d.ts vendored
View File

@@ -21,7 +21,7 @@ declare namespace App {
/** Whether info color is followed by the primary color */ /** Whether info color is followed by the primary color */
isInfoFollowPrimary: boolean; isInfoFollowPrimary: boolean;
/** Reset cache strategy */ /** Reset cache strategy */
resetCacheStrategy: UnionKey.ResetCacheStrategy; resetCacheStrategy?: UnionKey.ResetCacheStrategy;
/** Layout */ /** Layout */
layout: { layout: {
/** Layout mode */ /** Layout mode */
@@ -33,7 +33,7 @@ declare namespace App {
* *
* if true, the vertical child level menus in left and horizontal first level menus in top * if true, the vertical child level menus in left and horizontal first level menus in top
*/ */
reverseHorizontalMix: boolean; reverseHorizontalMix?: boolean;
}; };
/** Page */ /** Page */
page: { page: {
@@ -53,11 +53,6 @@ declare namespace App {
/** Whether to show the breadcrumb icon */ /** Whether to show the breadcrumb icon */
showIcon: boolean; showIcon: boolean;
}; };
/** Multilingual */
multilingual: {
/** Whether to show the multilingual */
visible: boolean;
};
}; };
/** Tab */ /** Tab */
tab: { tab: {
@@ -103,7 +98,7 @@ declare namespace App {
right: boolean; right: boolean;
}; };
/** Watermark */ /** Watermark */
watermark: { watermark?: {
/** Whether to show the watermark */ /** Whether to show the watermark */
visible: boolean; visible: boolean;
/** Watermark text */ /** Watermark text */
@@ -368,9 +363,6 @@ declare namespace App {
visible: string; visible: string;
showIcon: string; showIcon: string;
}; };
multilingual: {
visible: string;
};
}; };
tab: { tab: {
visible: string; visible: string;

View File

@@ -35,7 +35,10 @@ export default defineConfig(configEnv => {
host: '0.0.0.0', host: '0.0.0.0',
port: 9527, port: 9527,
open: true, open: true,
proxy: createViteProxy(viteEnv, enableProxy) proxy: createViteProxy(viteEnv, enableProxy),
fs: {
cachedChecks: false
}
}, },
preview: { preview: {
port: 9725 port: 9725