Compare commits
1 Commits
v1.3.11
...
tauri-v1.3
Author | SHA1 | Date | |
---|---|---|---|
|
c5ecd8adeb |
30
CHANGELOG.md
@@ -1,36 +1,6 @@
|
||||
# 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. - by @Azir-11 in https://github.com/soybeanjs/soybean-admin/issues/683 [<samp>(d7aeb)</samp>](https://github.com/soybeanjs/soybean-admin/commit/d7aebb7)
|
||||
|
||||
### 🐞 Bug Fixes
|
||||
|
||||
- **hooks**:
|
||||
- The total number before assigning a value to the table is incorrect. - 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 - 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 - 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)
|
||||
|
||||
### 🛠 Optimizations
|
||||
|
||||
- **projects**: optimize code - by @soybeanjs [<samp>(6489e)</samp>](https://github.com/soybeanjs/soybean-admin/commit/6489ec4)
|
||||
|
||||
### 📖 Documentation
|
||||
|
||||
- **projects**: update README - by @soybeanjs [<samp>(21434)</samp>](https://github.com/soybeanjs/soybean-admin/commit/214341e)
|
||||
|
||||
### 🏡 Chore
|
||||
|
||||
- **deps**: update deps - by @soybeanjs [<samp>(c9433)</samp>](https://github.com/soybeanjs/soybean-admin/commit/c9433e1)
|
||||
|
||||
### ❤️ Contributors
|
||||
|
||||
[](https://github.com/soybeanjs) [](https://github.com/Azir-11)
|
||||
|
||||
## [v1.3.10](https://github.com/honghuangdc/soybean-admin/compare/v1.3.9...v1.3.10) (2024-12-16)
|
||||
|
||||
### 🚀 Features
|
||||
|
@@ -49,7 +49,7 @@
|
||||
- [Github Repository](https://github.com/soybeanjs/soybean-admin-antd)
|
||||
- [Gitee Repository](https://gitee.com/honghuangdc/soybean-admin-antd)
|
||||
|
||||
- **ElementPlus Version:**
|
||||
- **ElementPlusVue Version:**
|
||||
- [Preview Link](https://elp.soybeanjs.cn/)
|
||||
- [Github Repository](https://github.com/soybeanjs/soybean-admin-element-plus)
|
||||
|
||||
@@ -113,10 +113,6 @@ pnpm dev
|
||||
pnpm build
|
||||
```
|
||||
|
||||
**Code Synchronization**
|
||||
|
||||
Refer to the [Code Synchronization](https://docs.soybeanjs.cn/guide/sync) document.
|
||||
|
||||
## Ecosystem
|
||||
|
||||
- [react-soybean-admin](https://github.com/mufeng889/react-soybean-admin): SoybeanAdmin based version of React.
|
||||
|
@@ -45,7 +45,7 @@
|
||||
- [预览地址](https://antd.soybeanjs.cn/)
|
||||
- [Github 仓库](https://github.com/soybeanjs/soybean-admin-antd)
|
||||
- [Gitee 仓库](https://gitee.com/honghuangdc/soybean-admin-antd)
|
||||
- **ElementPlus 版本:**
|
||||
- **ElementPlusVue 版本:**
|
||||
- [预览地址](https://elp.soybeanjs.cn/)
|
||||
- [Github 仓库](https://github.com/soybeanjs/soybean-admin-element-plus)
|
||||
- **旧版:**
|
||||
@@ -138,10 +138,6 @@ pnpm dev
|
||||
pnpm build
|
||||
```
|
||||
|
||||
**代码同步**
|
||||
|
||||
参考 [代码同步](https://docs.soybeanjs.cn/zh/guide/sync) 文档。
|
||||
|
||||
## 周边生态
|
||||
|
||||
- [react-soybean-admin](https://github.com/mufeng889/react-soybean-admin): 基于SoybeanAdmin的React版本.
|
||||
|
@@ -1,7 +1,7 @@
|
||||
import { defineConfig } from '@soybeanjs/eslint-config';
|
||||
|
||||
export default defineConfig(
|
||||
{ vue: true, unocss: true },
|
||||
{ vue: true, unocss: true, ignores: ['src-tauri/target'] },
|
||||
{
|
||||
rules: {
|
||||
'vue/multi-word-component-names': [
|
||||
|
53
package.json
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "soybean-admin",
|
||||
"type": "module",
|
||||
"version": "1.3.11",
|
||||
"version": "1.3.10",
|
||||
"description": "A fresh and elegant admin template, based on Vue3、Vite3、TypeScript、NaiveUI and UnoCSS. 一个基于Vue3、Vite3、TypeScript、NaiveUI and UnoCSS的清新优雅的中后台模版。",
|
||||
"author": {
|
||||
"name": "Soybean",
|
||||
@@ -32,74 +32,79 @@
|
||||
},
|
||||
"scripts": {
|
||||
"build": "vite build --mode prod",
|
||||
"build:tauri": "pnpm tauri build",
|
||||
"build:test": "vite build --mode test",
|
||||
"cleanup": "sa cleanup",
|
||||
"commit": "sa git-commit",
|
||||
"commit:zh": "sa git-commit -l=zh-cn",
|
||||
"dev": "vite --mode test",
|
||||
"dev:prod": "vite --mode prod",
|
||||
"dev:tauri": "pnpm tauri dev",
|
||||
"gen-route": "sa gen-route",
|
||||
"lint": "eslint . --fix",
|
||||
"prepare": "simple-git-hooks",
|
||||
"preview": "vite preview",
|
||||
"release": "sa release",
|
||||
"tauri-icon": "pnpm tauri icon ./public/logo.png",
|
||||
"typecheck": "vue-tsc --noEmit --skipLibCheck",
|
||||
"update-pkg": "sa update-pkg"
|
||||
},
|
||||
"dependencies": {
|
||||
"@better-scroll/core": "2.5.1",
|
||||
"@iconify/vue": "4.3.0",
|
||||
"@iconify/vue": "4.2.0",
|
||||
"@sa/axios": "workspace:*",
|
||||
"@sa/color": "workspace:*",
|
||||
"@sa/hooks": "workspace:*",
|
||||
"@sa/materials": "workspace:*",
|
||||
"@sa/utils": "workspace:*",
|
||||
"@vueuse/core": "12.4.0",
|
||||
"@tauri-apps/api": "2.1.1",
|
||||
"@vueuse/core": "12.0.0",
|
||||
"clipboard": "2.0.11",
|
||||
"dayjs": "1.11.13",
|
||||
"defu": "6.1.4",
|
||||
"echarts": "5.6.0",
|
||||
"echarts": "5.5.1",
|
||||
"json5": "2.2.3",
|
||||
"naive-ui": "2.41.0",
|
||||
"naive-ui": "2.40.3",
|
||||
"nprogress": "0.2.0",
|
||||
"pinia": "2.3.0",
|
||||
"tailwind-merge": "2.6.0",
|
||||
"tailwind-merge": "2.5.5",
|
||||
"vue": "3.5.13",
|
||||
"vue-draggable-plus": "0.6.0",
|
||||
"vue-i18n": "11.0.1",
|
||||
"vue-i18n": "10.0.5",
|
||||
"vue-router": "4.5.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@elegant-router/vue": "0.3.8",
|
||||
"@iconify/json": "2.2.297",
|
||||
"@iconify/json": "2.2.283",
|
||||
"@sa/scripts": "workspace:*",
|
||||
"@sa/uno-preset": "workspace:*",
|
||||
"@soybeanjs/eslint-config": "1.4.4",
|
||||
"@types/node": "22.10.7",
|
||||
"@tauri-apps/cli": "2.1.0",
|
||||
"@types/node": "22.10.2",
|
||||
"@types/nprogress": "0.2.3",
|
||||
"@unocss/eslint-config": "65.4.2",
|
||||
"@unocss/preset-icons": "65.4.2",
|
||||
"@unocss/preset-uno": "65.4.2",
|
||||
"@unocss/transformer-directives": "65.4.2",
|
||||
"@unocss/transformer-variant-group": "65.4.2",
|
||||
"@unocss/vite": "65.4.2",
|
||||
"@unocss/eslint-config": "0.65.1",
|
||||
"@unocss/preset-icons": "0.65.1",
|
||||
"@unocss/preset-uno": "0.65.1",
|
||||
"@unocss/transformer-directives": "0.65.1",
|
||||
"@unocss/transformer-variant-group": "0.65.1",
|
||||
"@unocss/vite": "0.65.1",
|
||||
"@vitejs/plugin-vue": "5.2.1",
|
||||
"@vitejs/plugin-vue-jsx": "4.1.1",
|
||||
"eslint": "9.18.0",
|
||||
"eslint": "9.17.0",
|
||||
"eslint-plugin-vue": "9.32.0",
|
||||
"lint-staged": "15.4.1",
|
||||
"sass": "1.83.4",
|
||||
"lint-staged": "15.2.11",
|
||||
"sass": "1.83.0",
|
||||
"simple-git-hooks": "2.11.1",
|
||||
"tsx": "4.19.2",
|
||||
"typescript": "5.7.3",
|
||||
"unplugin-icons": "22.0.0",
|
||||
"unplugin-vue-components": "28.0.0",
|
||||
"vite": "6.0.7",
|
||||
"typescript": "5.7.2",
|
||||
"unplugin-icons": "0.21.0",
|
||||
"unplugin-vue-components": "0.28.0",
|
||||
"vite": "6.0.3",
|
||||
"vite-plugin-progress": "0.0.7",
|
||||
"vite-plugin-svg-icons": "2.0.1",
|
||||
"vite-plugin-vue-devtools": "7.7.0",
|
||||
"vite-plugin-vue-devtools": "7.6.8",
|
||||
"vue-eslint-parser": "9.4.3",
|
||||
"vue-tsc": "2.2.0"
|
||||
"vue-tsc": "2.1.10"
|
||||
},
|
||||
"simple-git-hooks": {
|
||||
"commit-msg": "pnpm sa git-commit-verify",
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@sa/alova",
|
||||
"version": "1.3.11",
|
||||
"version": "1.3.10",
|
||||
"exports": {
|
||||
".": "./src/index.ts",
|
||||
"./fetch": "./src/fetch.ts",
|
||||
@@ -13,8 +13,8 @@
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"@alova/mock": "2.0.11",
|
||||
"@alova/mock": "2.0.10",
|
||||
"@sa/utils": "workspace:*",
|
||||
"alova": "3.2.8"
|
||||
"alova": "3.2.6"
|
||||
}
|
||||
}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@sa/axios",
|
||||
"version": "1.3.11",
|
||||
"version": "1.3.10",
|
||||
"exports": {
|
||||
".": "./src/index.ts"
|
||||
},
|
||||
@@ -13,9 +13,9 @@
|
||||
"@sa/utils": "workspace:*",
|
||||
"axios": "1.7.9",
|
||||
"axios-retry": "4.5.0",
|
||||
"qs": "6.14.0"
|
||||
"qs": "6.13.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/qs": "6.9.18"
|
||||
"@types/qs": "6.9.17"
|
||||
}
|
||||
}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@sa/color",
|
||||
"version": "1.3.11",
|
||||
"version": "1.3.10",
|
||||
"exports": {
|
||||
".": "./src/index.ts"
|
||||
},
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@sa/hooks",
|
||||
"version": "1.3.11",
|
||||
"version": "1.3.10",
|
||||
"exports": {
|
||||
".": "./src/index.ts"
|
||||
},
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@sa/materials",
|
||||
"version": "1.3.11",
|
||||
"version": "1.3.10",
|
||||
"exports": {
|
||||
".": "./src/index.ts"
|
||||
},
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@sa/fetch",
|
||||
"version": "1.3.11",
|
||||
"version": "1.3.10",
|
||||
"exports": {
|
||||
".": "./src/index.ts"
|
||||
},
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@sa/scripts",
|
||||
"version": "1.3.11",
|
||||
"version": "1.3.10",
|
||||
"bin": {
|
||||
"sa": "./bin.ts"
|
||||
},
|
||||
@@ -14,14 +14,14 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@soybeanjs/changelog": "0.3.24",
|
||||
"bumpp": "9.10.1",
|
||||
"bumpp": "9.9.1",
|
||||
"c12": "2.0.1",
|
||||
"cac": "6.7.14",
|
||||
"consola": "3.4.0",
|
||||
"consola": "3.2.3",
|
||||
"enquirer": "2.4.1",
|
||||
"execa": "9.5.2",
|
||||
"kolorist": "1.8.0",
|
||||
"npm-check-updates": "17.1.14",
|
||||
"npm-check-updates": "17.1.11",
|
||||
"rimraf": "6.0.1"
|
||||
}
|
||||
}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@sa/uno-preset",
|
||||
"version": "1.3.11",
|
||||
"version": "1.3.10",
|
||||
"exports": {
|
||||
".": "./src/index.ts"
|
||||
},
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@sa/utils",
|
||||
"version": "1.3.11",
|
||||
"version": "1.3.10",
|
||||
"exports": {
|
||||
".": "./src/index.ts"
|
||||
},
|
||||
|
2449
pnpm-lock.yaml
generated
BIN
public/logo.png
Normal file
After Width: | Height: | Size: 20 KiB |
3
src-tauri/.gitignore
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
# Generated by Cargo
|
||||
# will have compiled files and executables
|
||||
/target/
|
3664
src-tauri/Cargo.lock
generated
Normal file
26
src-tauri/Cargo.toml
Normal file
@@ -0,0 +1,26 @@
|
||||
[package]
|
||||
name = "app"
|
||||
version = "0.1.0"
|
||||
description = "A Tauri App"
|
||||
authors = ["you"]
|
||||
license = ""
|
||||
repository = ""
|
||||
default-run = "app"
|
||||
edition = "2021"
|
||||
rust-version = "1.60"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[build-dependencies]
|
||||
tauri-build = { version = "2", features = [] }
|
||||
|
||||
[dependencies]
|
||||
serde_json = "1.0"
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
tauri = { version = "2", features = [] }
|
||||
|
||||
[features]
|
||||
# this feature is used for production builds or when `devPath` points to the filesystem and the built-in dev server is disabled.
|
||||
# If you use cargo directly instead of tauri's cli you can use this feature flag to switch between tauri's `dev` and `build` modes.
|
||||
# DO NOT REMOVE!!
|
||||
custom-protocol = [ "tauri/custom-protocol" ]
|
3
src-tauri/build.rs
Normal file
@@ -0,0 +1,3 @@
|
||||
fn main() {
|
||||
tauri_build::build()
|
||||
}
|
7
src-tauri/capabilities/migrated.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"identifier": "migrated",
|
||||
"description": "permissions that were migrated from v1",
|
||||
"local": true,
|
||||
"windows": ["main"],
|
||||
"permissions": ["core:default"]
|
||||
}
|
BIN
src-tauri/icons/128x128.png
Normal file
After Width: | Height: | Size: 8.8 KiB |
BIN
src-tauri/icons/128x128@2x.png
Normal file
After Width: | Height: | Size: 19 KiB |
BIN
src-tauri/icons/32x32.png
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
src-tauri/icons/Square107x107Logo.png
Normal file
After Width: | Height: | Size: 7.4 KiB |
BIN
src-tauri/icons/Square142x142Logo.png
Normal file
After Width: | Height: | Size: 9.9 KiB |
BIN
src-tauri/icons/Square150x150Logo.png
Normal file
After Width: | Height: | Size: 10 KiB |
BIN
src-tauri/icons/Square284x284Logo.png
Normal file
After Width: | Height: | Size: 21 KiB |
BIN
src-tauri/icons/Square30x30Logo.png
Normal file
After Width: | Height: | Size: 1.6 KiB |
BIN
src-tauri/icons/Square310x310Logo.png
Normal file
After Width: | Height: | Size: 23 KiB |
BIN
src-tauri/icons/Square44x44Logo.png
Normal file
After Width: | Height: | Size: 2.6 KiB |
BIN
src-tauri/icons/Square71x71Logo.png
Normal file
After Width: | Height: | Size: 4.7 KiB |
BIN
src-tauri/icons/Square89x89Logo.png
Normal file
After Width: | Height: | Size: 6.1 KiB |
BIN
src-tauri/icons/StoreLogo.png
Normal file
After Width: | Height: | Size: 3.0 KiB |
BIN
src-tauri/icons/icon.icns
Normal file
BIN
src-tauri/icons/icon.ico
Normal file
After Width: | Height: | Size: 31 KiB |
BIN
src-tauri/icons/icon.png
Normal file
After Width: | Height: | Size: 39 KiB |
8
src-tauri/src/main.rs
Normal file
@@ -0,0 +1,8 @@
|
||||
// Prevents additional console window on Windows in release, DO NOT REMOVE!!
|
||||
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
|
||||
|
||||
fn main() {
|
||||
tauri::Builder::default()
|
||||
.run(tauri::generate_context!())
|
||||
.expect("error while running tauri application");
|
||||
}
|
57
src-tauri/tauri.conf.json
Normal file
@@ -0,0 +1,57 @@
|
||||
{
|
||||
"$schema": "../node_modules/@tauri-apps/cli/config.schema.json",
|
||||
"build": {
|
||||
"beforeBuildCommand": "npm run build",
|
||||
"beforeDevCommand": "npm run dev",
|
||||
"frontendDist": "../dist",
|
||||
"devUrl": "http://localhost:9527"
|
||||
},
|
||||
"bundle": {
|
||||
"active": true,
|
||||
"category": "DeveloperTool",
|
||||
"copyright": "",
|
||||
"targets": "all",
|
||||
"externalBin": [],
|
||||
"icon": ["icons/32x32.png", "icons/128x128.png", "icons/128x128@2x.png", "icons/icon.icns", "icons/icon.ico"],
|
||||
"windows": {
|
||||
"certificateThumbprint": null,
|
||||
"digestAlgorithm": "sha256",
|
||||
"timestampUrl": ""
|
||||
},
|
||||
"longDescription": "",
|
||||
"macOS": {
|
||||
"entitlements": null,
|
||||
"exceptionDomain": "",
|
||||
"frameworks": [],
|
||||
"providerShortName": null,
|
||||
"signingIdentity": null
|
||||
},
|
||||
"resources": [],
|
||||
"shortDescription": "",
|
||||
"linux": {
|
||||
"deb": {
|
||||
"depends": []
|
||||
}
|
||||
}
|
||||
},
|
||||
"productName": "soybean-admin",
|
||||
"mainBinaryName": "soybean-admin",
|
||||
"version": "1.0.0",
|
||||
"identifier": "cn.soybeanjs.admin",
|
||||
"plugins": {},
|
||||
"app": {
|
||||
"windows": [
|
||||
{
|
||||
"fullscreen": false,
|
||||
"height": 768,
|
||||
"resizable": true,
|
||||
"title": "SoybeanAdmin",
|
||||
"width": 1366,
|
||||
"useHttpsScheme": true
|
||||
}
|
||||
],
|
||||
"security": {
|
||||
"csp": null
|
||||
}
|
||||
}
|
||||
}
|
@@ -102,9 +102,9 @@ export function useRouterPush(inSetup = true) {
|
||||
const redirect = route.value.query?.redirect as string;
|
||||
|
||||
if (needRedirect && redirect) {
|
||||
await routerPush(redirect);
|
||||
routerPush(redirect);
|
||||
} else {
|
||||
await toHome();
|
||||
toHome();
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -119,7 +119,6 @@ export function useTable<A extends NaiveUI.TableApiFn>(config: NaiveUI.NaiveTabl
|
||||
page: 1,
|
||||
pageSize: 10,
|
||||
showSizePicker: true,
|
||||
itemCount: 0,
|
||||
pageSizes: [10, 15, 20, 25, 30],
|
||||
onUpdatePage: async (page: number) => {
|
||||
pagination.page = page;
|
||||
|
@@ -40,12 +40,7 @@ const { isFullscreen, toggle } = useFullscreen();
|
||||
<div class="h-full flex-y-center justify-end">
|
||||
<GlobalSearch />
|
||||
<FullScreen v-if="!appStore.isMobile" :full="isFullscreen" @click="toggle" />
|
||||
<LangSwitch
|
||||
v-if="themeStore.header.multilingual.visible"
|
||||
:lang="appStore.locale"
|
||||
:lang-options="appStore.localeOptions"
|
||||
@change-lang="appStore.changeLocale"
|
||||
/>
|
||||
<LangSwitch :lang="appStore.locale" :lang-options="appStore.localeOptions" @change-lang="appStore.changeLocale" />
|
||||
<ThemeSchemaSwitch
|
||||
:theme-schema="themeStore.themeScheme"
|
||||
:is-dark="themeStore.darkMode"
|
||||
|
@@ -127,9 +127,6 @@ const isWrapperScrollMode = computed(() => themeStore.layout.scrollMode === 'wra
|
||||
placeholder="SoybeanAdmin"
|
||||
/>
|
||||
</SettingItem>
|
||||
<SettingItem key="9" :label="$t('theme.header.multilingual.visible')">
|
||||
<NSwitch v-model:value="themeStore.header.multilingual.visible" />
|
||||
</SettingItem>
|
||||
</TransitionGroup>
|
||||
</template>
|
||||
|
||||
|
@@ -109,9 +109,6 @@ const local: App.I18n.Schema = {
|
||||
breadcrumb: {
|
||||
visible: 'Breadcrumb Visible',
|
||||
showIcon: 'Breadcrumb Icon Visible'
|
||||
},
|
||||
multilingual: {
|
||||
visible: 'Display multilingual button'
|
||||
}
|
||||
},
|
||||
tab: {
|
||||
|
@@ -109,9 +109,6 @@ const local: App.I18n.Schema = {
|
||||
breadcrumb: {
|
||||
visible: '显示面包屑',
|
||||
showIcon: '显示面包屑图标'
|
||||
},
|
||||
multilingual: {
|
||||
visible: '显示多语言按钮'
|
||||
}
|
||||
},
|
||||
tab: {
|
||||
|
@@ -10,18 +10,22 @@ export function setupAppErrorHandle(app: App) {
|
||||
};
|
||||
}
|
||||
|
||||
export function setupAppVersionNotification() {
|
||||
// Update check interval in milliseconds
|
||||
const UPDATE_CHECK_INTERVAL = 3 * 60 * 1000;
|
||||
// Update check interval in milliseconds
|
||||
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;
|
||||
|
||||
let isShow = false;
|
||||
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 () => {
|
||||
if (isShow) return;
|
||||
if (!shouldCheckForUpdates) return;
|
||||
|
||||
const buildTime = await getHtmlBuildTime();
|
||||
|
||||
@@ -43,7 +47,6 @@ export function setupAppVersionNotification() {
|
||||
{
|
||||
onClick() {
|
||||
n?.destroy();
|
||||
isShow = false;
|
||||
}
|
||||
},
|
||||
() => $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 (!isShow && document.visibilityState === 'visible') {
|
||||
if (shouldCheckForUpdates) {
|
||||
// Check for updates when the document is visible
|
||||
document.addEventListener('visibilitychange', () => {
|
||||
if (document.visibilityState === 'visible') {
|
||||
|
@@ -71,11 +71,13 @@ export const useAuthStore = defineStore(SetupStoreId.Auth, () => {
|
||||
if (pass) {
|
||||
await redirectFromLogin(redirect);
|
||||
|
||||
window.$notification?.success({
|
||||
title: $t('page.login.common.loginSuccess'),
|
||||
content: $t('page.login.common.welcomeBack', { userName: userInfo.userName }),
|
||||
duration: 4500
|
||||
});
|
||||
if (routeStore.isInitAuthRoute) {
|
||||
window.$notification?.success({
|
||||
title: $t('page.login.common.loginSuccess'),
|
||||
content: $t('page.login.common.welcomeBack', { userName: userInfo.userName }),
|
||||
duration: 4500
|
||||
});
|
||||
}
|
||||
}
|
||||
} else {
|
||||
resetStore();
|
||||
|
@@ -27,9 +27,6 @@ export const themeSettings: App.Theme.ThemeSetting = {
|
||||
breadcrumb: {
|
||||
visible: true,
|
||||
showIcon: true
|
||||
},
|
||||
multilingual: {
|
||||
visible: true
|
||||
}
|
||||
},
|
||||
tab: {
|
||||
|
8
src/typings/app.d.ts
vendored
@@ -53,11 +53,6 @@ declare namespace App {
|
||||
/** Whether to show the breadcrumb icon */
|
||||
showIcon: boolean;
|
||||
};
|
||||
/** Multilingual */
|
||||
multilingual: {
|
||||
/** Whether to show the multilingual */
|
||||
visible: boolean;
|
||||
};
|
||||
};
|
||||
/** Tab */
|
||||
tab: {
|
||||
@@ -368,9 +363,6 @@ declare namespace App {
|
||||
visible: string;
|
||||
showIcon: string;
|
||||
};
|
||||
multilingual: {
|
||||
visible: string;
|
||||
};
|
||||
};
|
||||
tab: {
|
||||
visible: string;
|
||||
|