Merge branch 'main' into example

This commit is contained in:
Soybean 2024-12-16 16:44:43 +08:00
commit 745a9077ec
24 changed files with 2128 additions and 2010 deletions

View File

@ -1,6 +1,40 @@
# Changelog
## [v1.3.10](https://github.com/honghuangdc/soybean-admin/compare/v1.3.9...v1.3.10) (2024-12-16)
###    🚀 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)
### &nbsp;&nbsp;&nbsp;🚀 Features

View File

@ -49,6 +49,10 @@
- [Github Repository](https://github.com/soybeanjs/soybean-admin-antd)
- [Gitee Repository](https://gitee.com/honghuangdc/soybean-admin-antd)
- **ElementPlusVue Version:**
- [Preview Link](https://elp.soybeanjs.cn/)
- [Github Repository](https://github.com/soybeanjs/soybean-admin-element-plus)
- **Legacy Version:**
- [Preview Link](https://legacy.soybeanjs.cn/)
- [Github Repository](https://github.com/soybeanjs/soybean-admin/tree/legacy)

View File

@ -41,12 +41,13 @@
- [预览地址](https://naive.soybeanjs.cn/)
- [Github 仓库](https://github.com/soybeanjs/soybean-admin)
- [Gitee 仓库](https://gitee.com/honghuangdc/soybean-admin)
- **AntDesignVue 版本:**
- [预览地址](https://antd.soybeanjs.cn/)
- [Github 仓库](https://github.com/soybeanjs/soybean-admin-antd)
- [Gitee 仓库](https://gitee.com/honghuangdc/soybean-admin-antd)
- **ElementPlusVue 版本:**
- [预览地址](https://elp.soybeanjs.cn/)
- [Github 仓库](https://github.com/soybeanjs/soybean-admin-element-plus)
- **旧版:**
- [预览地址](https://legacy.soybeanjs.cn/)
- [Github 仓库](https://github.com/soybeanjs/soybean-admin/tree/legacy)

View File

@ -1,7 +1,7 @@
{
"name": "soybean-admin",
"type": "module",
"version": "1.3.9",
"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",
@ -48,44 +48,45 @@
},
"dependencies": {
"@antv/data-set": "0.11.8",
"@antv/g2": "5.2.7",
"@antv/g6": "5.0.30",
"@antv/g2": "5.2.10",
"@antv/g6": "5.0.35",
"@better-scroll/core": "2.5.1",
"@iconify/vue": "4.1.2",
"@iconify/vue": "4.2.0",
"@sa/alova": "workspace:*",
"@sa/axios": "workspace:*",
"@sa/color": "workspace:*",
"@sa/hooks": "workspace:*",
"@sa/materials": "workspace:*",
"@sa/utils": "workspace:*",
"@visactor/vchart": "1.12.11",
"@visactor/vchart": "1.13.1",
"@visactor/vchart-theme": "1.12.2",
"@visactor/vtable-editors": "1.10.5",
"@visactor/vtable-gantt": "1.10.5",
"@visactor/vue-vtable": "1.10.5",
"@vueuse/components": "11.2.0",
"@vueuse/core": "11.2.0",
"@visactor/vtable-editors": "1.13.1",
"@visactor/vtable-gantt": "1.13.1",
"@visactor/vue-vtable": "1.13.1",
"@vueuse/components": "12.0.0",
"@vueuse/core": "12.0.0",
"clipboard": "2.0.11",
"dayjs": "1.11.13",
"dhtmlx-gantt": "9.0.2",
"dompurify": "3.2.0",
"defu": "6.1.4",
"dhtmlx-gantt": "9.0.3",
"dompurify": "3.2.3",
"echarts": "5.5.1",
"jsbarcode": "3.11.6",
"json5": "2.2.3",
"naive-ui": "2.40.1",
"naive-ui": "2.40.3",
"nprogress": "0.2.0",
"pinia": "2.2.6",
"pinia": "2.3.0",
"pinyin-pro": "3.26.0",
"print-js": "1.6.0",
"swiper": "11.1.14",
"tailwind-merge": "2.5.4",
"swiper": "11.1.15",
"tailwind-merge": "2.5.5",
"typeit": "8.8.7",
"vditor": "3.10.7",
"vditor": "3.10.8",
"vue": "3.5.13",
"vue-draggable-plus": "0.6.0",
"vue-i18n": "10.0.4",
"vue-i18n": "10.0.5",
"vue-pdf-embed": "2.1.1",
"vue-router": "4.4.5",
"vue-router": "4.5.0",
"wangeditor": "4.7.15",
"xgplayer": "3.0.20",
"xlsx": "0.18.5"
@ -93,35 +94,35 @@
"devDependencies": {
"@amap/amap-jsapi-types": "0.0.15",
"@elegant-router/vue": "0.3.8",
"@iconify/json": "2.2.273",
"@iconify/json": "2.2.283",
"@sa/scripts": "workspace:*",
"@sa/uno-preset": "workspace:*",
"@soybeanjs/eslint-config": "1.4.2",
"@soybeanjs/eslint-config": "1.4.4",
"@types/bmapgl": "0.0.7",
"@types/dompurify": "3.0.5",
"@types/node": "22.9.0",
"@types/dompurify": "3.2.0",
"@types/node": "22.10.2",
"@types/nprogress": "0.2.3",
"@unocss/eslint-config": "0.64.1",
"@unocss/preset-icons": "0.64.1",
"@unocss/preset-uno": "0.64.1",
"@unocss/transformer-directives": "0.64.1",
"@unocss/transformer-variant-group": "0.64.1",
"@unocss/vite": "0.64.1",
"@vitejs/plugin-vue": "5.2.0",
"@vitejs/plugin-vue-jsx": "4.1.0",
"eslint": "9.14.0",
"eslint-plugin-vue": "9.31.0",
"lint-staged": "15.2.10",
"sass": "1.81.0",
"@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.17.0",
"eslint-plugin-vue": "9.32.0",
"lint-staged": "15.2.11",
"sass": "1.83.0",
"simple-git-hooks": "2.11.1",
"tsx": "4.19.2",
"typescript": "5.6.3",
"unplugin-icons": "0.20.1",
"unplugin-vue-components": "0.27.4",
"vite": "5.4.11",
"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.6.4",
"vite-plugin-vue-devtools": "7.6.8",
"vue-eslint-parser": "9.4.3",
"vue-tsc": "2.1.10"
},

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

File diff suppressed because it is too large Load Diff

View File

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

View File

@ -114,10 +114,10 @@ const isWrapperScrollMode = computed(() => themeStore.layout.scrollMode === 'wra
>
<NSwitch v-model:value="themeStore.footer.right" />
</SettingItem>
<SettingItem v-if="themeStore.watermark" key="8" :label="$t('theme.watermark.visible')">
<SettingItem key="8" :label="$t('theme.watermark.visible')">
<NSwitch v-model:value="themeStore.watermark.visible" />
</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
v-model:value="themeStore.watermark.text"
autosize

View File

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

View File

@ -69,8 +69,6 @@ export const useAuthStore = defineStore(SetupStoreId.Auth, () => {
const pass = await loginByToken(loginToken);
if (pass) {
await routeStore.initAuthRoute();
await redirectFromLogin(redirect);
if (routeStore.isInitAuthRoute) {

View File

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

View File

@ -1,4 +1,5 @@
import type { GlobalThemeOverrides } from 'naive-ui';
import { defu } from 'defu';
import { addColorAlpha, getColorPalette, getPaletteColorByNumber, getRgb } from '@sa/color';
import { overrideThemeSettings, themeSettings } from '@/theme/settings';
import { themeVars } from '@/theme/vars';
@ -17,12 +18,15 @@ export function initThemeSettings() {
// 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`
const settings = localStg.get('themeSettings') || themeSettings;
const localSettings = localStg.get('themeSettings');
let settings = defu(localSettings, themeSettings);
const isOverride = localStg.get('overrideThemeFlag') === BUILD_TIME;
if (!isOverride) {
Object.assign(settings, overrideThemeSettings);
settings = defu(overrideThemeSettings, settings);
localStg.set('overrideThemeFlag', BUILD_TIME);
}

View File

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

View File

@ -21,7 +21,7 @@ declare namespace App {
/** Whether info color is followed by the primary color */
isInfoFollowPrimary: boolean;
/** Reset cache strategy */
resetCacheStrategy?: UnionKey.ResetCacheStrategy;
resetCacheStrategy: UnionKey.ResetCacheStrategy;
/** Layout */
layout: {
/** 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
*/
reverseHorizontalMix?: boolean;
reverseHorizontalMix: boolean;
};
/** Page */
page: {
@ -98,7 +98,7 @@ declare namespace App {
right: boolean;
};
/** Watermark */
watermark?: {
watermark: {
/** Whether to show the watermark */
visible: boolean;
/** Watermark text */

View File

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