chore(projects): merge branch main into example

This commit is contained in:
Soybean 2024-06-15 01:13:36 +08:00
commit d3210edc6a
18 changed files with 448 additions and 371 deletions

View File

@ -1,6 +1,35 @@
# Changelog
## [v1.2.5](https://github.com/soybeanjs/soybean-admin/compare/v1.2.4...v1.2.5) (2024-06-15)
###    🐞 Bug Fixes
- **projects**: Fix the issue of abnormal tab caching after logout. fixed #495 &nbsp;-&nbsp; by @Azir-11 in https://github.com/soybeanjs/soybean-admin/issues/495 [<samp>(3eeac)</samp>](https://github.com/soybeanjs/soybean-admin/commit/3eeace9)
### &nbsp;&nbsp;&nbsp;🔥 Performance
- **project**: Initializing the static routing function does not require asynchronization &nbsp;-&nbsp; by **CHENZL** in https://github.com/soybeanjs/soybean-admin/issues/493 [<samp>(2198b)</samp>](https://github.com/soybeanjs/soybean-admin/commit/2198b98)
### &nbsp;&nbsp;&nbsp;🛠 Optimizations
- **projects**: optimize code &nbsp;-&nbsp; by @soybeanjs [<samp>(b94ba)</samp>](https://github.com/soybeanjs/soybean-admin/commit/b94baa1)
- **types**: Enhance compatibility of global types &nbsp;-&nbsp; by @Azir-11 in https://github.com/soybeanjs/soybean-admin/issues/494 [<samp>(cd9d5)</samp>](https://github.com/soybeanjs/soybean-admin/commit/cd9d58d)
- **utils**: Reduce code indentation and improve readability &nbsp;-&nbsp; by @Azir-11 in https://github.com/soybeanjs/soybean-admin/issues/496 [<samp>(ad2f2)</samp>](https://github.com/soybeanjs/soybean-admin/commit/ad2f247)
### &nbsp;&nbsp;&nbsp;📖 Documentation
- **projects**: update CHANGELOG &nbsp;-&nbsp; by @soybeanjs [<samp>(b3368)</samp>](https://github.com/soybeanjs/soybean-admin/commit/b336841)
### &nbsp;&nbsp;&nbsp;🏡 Chore
- **deps**: update deps &nbsp;-&nbsp; by @soybeanjs [<samp>(b094d)</samp>](https://github.com/soybeanjs/soybean-admin/commit/b094d68)
### &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;
[CHENZL](mailto:zlong5568863@qq.com)
## [v1.2.4](https://github.com/soybeanjs/soybean-admin/compare/v1.2.3...v1.2.4) (2024-06-14)
### &nbsp;&nbsp;&nbsp;🛠 Optimizations

View File

@ -1,6 +1,114 @@
# 更新日志
## [v1.2.5](https://github.com/soybeanjs/soybean-admin/compare/v1.2.4...v1.2.5) (2024-06-15)
### &nbsp;&nbsp;&nbsp;🐞 错误修复
- **项目**: 修复登出后标签页异常缓存的问题。已修复 #495 &nbsp;-&nbsp;@Azir-11 在 https://github.com/soybeanjs/soybean-admin/issues/495 [<samp>(3eeac)</samp>](https://github.com/soybeanjs/soybean-admin/commit/3eeace9)
### &nbsp;&nbsp;&nbsp;🔥 性能
- **项目**: 初始化静态路由功能不需要异步 &nbsp;-&nbsp;**CHENZL** 在 https://github.com/soybeanjs/soybean-admin/issues/493 [<samp>(2198b)</samp>](https://github.com/soybeanjs/soybean-admin/commit/2198b98)
### &nbsp;&nbsp;&nbsp;🛠 优化
- **项目**: 优化代码 &nbsp;-&nbsp;@soybeanjs [<samp>(b94ba)</samp>](https://github.com/soybeanjs/soybean-admin/commit/b94baa1)
- **类型**: 提高全局类型的兼容性 &nbsp;-&nbsp;@Azir-11 在 https://github.com/soybeanjs/soybean-admin/issues/494 [<samp>(cd9d5)</samp>](https://github.com/soybeanjs/soybean-admin/commit/cd9d58d)
- **工具**: 减少代码缩进,提高可读性 &nbsp;-&nbsp;@Azir-11 在 https://github.com/soybeanjs/soybean-admin/issues/496 [<samp>(ad2f2)</samp>](https://github.com/soybeanjs/soybean-admin/commit/ad2f247)
### &nbsp;&nbsp;&nbsp;📖 文档
- **项目**: 更新CHANGELOG &nbsp;-&nbsp;@soybeanjs [<samp>(f70d2)</samp>](https://github.com/soybeanjs/soybean-admin/commit/f70d29b)
### &nbsp;&nbsp;&nbsp;🏡 杂项
- **依赖**: 更新依赖 &nbsp;-&nbsp;@soybeanjs [<samp>(b094d)</samp>](https://github.com/soybeanjs/soybean-admin/commit/b094d68)
### &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;
[CHENZL](mailto:zlong5568863@qq.com)
## [v1.2.4](https://github.com/soybeanjs/soybean-admin/compare/v1.2.3...v1.2.4) (2024-06-14)
### &nbsp;&nbsp;&nbsp;🛠 优化
- **项目**:
- 优化 `setupAppVersionNotification` &nbsp;-&nbsp;@soybeanjs 提交 [<samp>(b5a72)</samp>](https://github.com/soybeanjs/soybean-admin/commit/b5a723c)
- 获取 'Asia/Shanghai' 时区的构建时间 &nbsp;-&nbsp;@soybeanjs 提交 [<samp>(069fa)</samp>](https://github.com/soybeanjs/soybean-admin/commit/069fa8a)
### &nbsp;&nbsp;&nbsp;❤️ 贡献者
[![soybeanjs](https://github.com/soybeanjs.png?size=48)](https://github.com/soybeanjs)&nbsp;&nbsp;
## [v1.2.3](https://github.com/soybeanjs/soybean-admin/compare/v1.2.2...v1.2.3) (2024-06-13)
### &nbsp;&nbsp;&nbsp;🐞 修复错误
- **项目**:
- 通过在index.html中添加color-scheme元标签修复移动浏览器主题问题 &nbsp;-&nbsp;@KickCashew 在 https://github.com/soybeanjs/soybean-admin/issues/488 中提交 [<samp>(c2125)</samp>](https://github.com/soybeanjs/soybean-admin/commit/c212565)
- 修复二级目录组件为空 &nbsp;-&nbsp;@paynezhuang 在 https://github.com/soybeanjs/soybean-admin/issues/491 中提交 [<samp>(aabb2)</samp>](https://github.com/soybeanjs/soybean-admin/commit/aabb2a4)
### &nbsp;&nbsp;&nbsp;📖 文档
- **项目**:
- 修复超链接指向错误 &nbsp;-&nbsp;**Azir** 提交 [<samp>(20a81)</samp>](https://github.com/soybeanjs/soybean-admin/commit/20a8127)
- 更新 README &nbsp;-&nbsp;@soybeanjs 提交 [<samp>(70261)</samp>](https://github.com/soybeanjs/soybean-admin/commit/7026126)
### &nbsp;&nbsp;&nbsp;🏡 杂项
- **依赖**:
- 更新依赖 &nbsp;-&nbsp;@soybeanjs 提交 [<samp>(813d8)</samp>](https://github.com/soybeanjs/soybean-admin/commit/813d8ce)
- 更新依赖 &nbsp;-&nbsp;@soybeanjs 提交 [<samp>(bf718)</samp>](https://github.com/soybeanjs/soybean-admin/commit/bf71837)
### &nbsp;&nbsp;&nbsp;❤️ 贡献者
[![soybeanjs](https://github.com/soybeanjs.png?size=48)](https://github.com/soybeanjs)&nbsp;&nbsp;[![paynezhuang](https://github.com/paynezhuang.png?size=48)](https://github.com/paynezhuang)&nbsp;&nbsp;[![KickCashew](https://github.com/KickCashew.png?size=48)](https://github.com/KickCashew)&nbsp;&nbsp;
[Azir](mailto:2075125282@qq.com)
## [v1.2.2](https://github.com/honghuangdc/soybean-admin/compare/v1.2.1...v1.2.2) (2024-06-12)
### &nbsp;&nbsp;&nbsp;🚀 特性
- **项目**: 切换标签时重置滚动位置 &nbsp;-&nbsp;@soybeanjs 提交 [<samp>(9094b)</samp>](https://github.com/honghuangdc/soybean-admin/commit/9094b21)
### &nbsp;&nbsp;&nbsp;🐞 修复错误
- **项目**:
- 在DEV模式下隐藏AppVersionNotification &nbsp;-&nbsp;@sigma-plus 在 https://github.com/honghuangdc/soybean-admin/issues/482 中提交 [<samp>(62592)</samp>](https://github.com/honghuangdc/soybean-admin/commit/6259287)
- 修复在移动布局中隐藏menu-toggler。fixed #483 &nbsp;-&nbsp;@soybeanjs 在 https://github.com/honghuangdc/soybean-admin/issues/483 中提交 [<samp>(4470c)</samp>](https://github.com/honghuangdc/soybean-admin/commit/4470cb4)
### &nbsp;&nbsp;&nbsp;📖 文档
- **项目**: 更新 README &nbsp;-&nbsp;@soybeanjs 提交 [<samp>(8f9a7)</samp>](https://github.com/honghuangdc/soybean-admin/commit/8f9a705)
### &nbsp;&nbsp;&nbsp;❤️ 贡献者
[![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;🐞 修复错误
- **项目**:
- 修复页面重新加载时获取用户信息 &nbsp;-&nbsp;@soybeanjs 提交 [<samp>(ff51b)</samp>](https://github.com/honghuangdc/soybean-admin/commit/ff51b72)
- 修复setupAppVersionNotification渲染 &nbsp;-&nbsp;@soybeanjs 提交 [<samp>(6a6eb)</samp>](https://github.com/honghuangdc/soybean-admin/commit/6a6eb9a)
### &nbsp;&nbsp;&nbsp;📖 文档
- **项目**: 更新CHANGELOG &nbsp;-&nbsp;@soybeanjs [<samp>(fe06b)</samp>](https://github.com/honghuangdc/soybean-admin/commit/fe06b8c)完成
### &nbsp;&nbsp;&nbsp;🏡 日常任务
- **依赖**: 更新依赖 &nbsp;-&nbsp;@soybeanjs [<samp>(08827)</samp>](https://github.com/honghuangdc/soybean-admin/commit/08827a4)完成
### &nbsp;&nbsp;&nbsp;❤️ 贡献者
[![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;🚀 功能

View File

@ -1,7 +1,7 @@
{
"name": "soybean-admin",
"type": "module",
"version": "1.2.4",
"version": "1.2.5",
"description": "A fresh and elegant admin template, based on Vue3、Vite3、TypeScript、NaiveUI and UnoCSS. 一个基于Vue3、Vite3、TypeScript、NaiveUI and UnoCSS的清新优雅的中后台模版。",
"author": {
"name": "Soybean",
@ -68,7 +68,7 @@
"swiper": "11.1.1",
"tailwind-merge": "2.3.0",
"vditor": "3.10.4",
"vue": "3.4.27",
"vue": "3.4.29",
"vue-draggable-plus": "0.5.0",
"vue-i18n": "9.13.1",
"vue-router": "4.3.3",
@ -78,10 +78,10 @@
"devDependencies": {
"@amap/amap-jsapi-types": "0.0.8",
"@elegant-router/vue": "0.3.7",
"@iconify/json": "2.2.218",
"@iconify/json": "2.2.219",
"@sa/scripts": "workspace:*",
"@sa/uno-preset": "workspace:*",
"@soybeanjs/eslint-config": "1.3.6",
"@soybeanjs/eslint-config": "1.3.7",
"@types/bmapgl": "0.0.5",
"@types/lodash-es": "4.17.12",
"@types/node": "20.14.2",
@ -103,7 +103,7 @@
"typescript": "5.4.5",
"unplugin-icons": "0.19.0",
"unplugin-vue-components": "0.27.0",
"vite": "5.3.0",
"vite": "5.3.1",
"vite-plugin-progress": "0.0.7",
"vite-plugin-svg-icons": "2.0.1",
"vite-plugin-vue-devtools": "7.2.1",

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,6 +1,6 @@
{
"name": "@sa/scripts",
"version": "1.2.4",
"version": "1.2.5",
"bin": {
"sa": "./bin.ts"
},

View File

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

View File

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

File diff suppressed because it is too large Load Diff

View File

@ -12,40 +12,42 @@ export function setupAppVersionNotification() {
const buildTime = await getHtmlBuildTime();
if (buildTime !== BUILD_TIME) {
isShow = true;
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')
)
]);
},
onClose() {
isShow = false;
}
});
if (buildTime === BUILD_TIME) {
return;
}
isShow = true;
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')
)
]);
},
onClose() {
isShow = false;
}
});
});
}

View File

@ -8,11 +8,13 @@ import { fetchGetUserInfo, fetchLogin } from '@/service/api';
import { localStg } from '@/utils/storage';
import { $t } from '@/locales';
import { useRouteStore } from '../route';
import { useTabStore } from '../tab';
import { clearAuthStorage, getToken } from './shared';
export const useAuthStore = defineStore(SetupStoreId.Auth, () => {
const route = useRoute();
const routeStore = useRouteStore();
const tabStore = useTabStore();
const { toLogin, redirectFromLogin } = useRouterPush(false);
const { loading: loginLoading, startLoading, endLoading } = useLoading();
@ -47,6 +49,7 @@ export const useAuthStore = defineStore(SetupStoreId.Auth, () => {
await toLogin();
}
tabStore.cacheTabs();
routeStore.resetStore();
}

View File

@ -219,7 +219,7 @@ export const useRouteStore = defineStore(SetupStoreId.Route, () => {
/** Init auth route */
async function initAuthRoute() {
if (authRouteMode.value === 'static') {
await initStaticAuthRoute();
initStaticAuthRoute();
} else {
await initDynamicAuthRoute();
}
@ -228,7 +228,7 @@ export const useRouteStore = defineStore(SetupStoreId.Route, () => {
}
/** Init static auth route */
async function initStaticAuthRoute() {
function initStaticAuthRoute() {
const { authRoutes: staticAuthRoutes } = createStaticRoutes();
if (authStore.isStaticSuper) {

View File

@ -290,6 +290,7 @@ export const useTabStore = defineStore(SetupStoreId.Tab, () => {
resetTabLabel,
isTabRetain,
updateTabsByLocale,
getTabIdByRoute
getTabIdByRoute,
cacheTabs
};
});

View File

@ -105,3 +105,7 @@ declare namespace Env {
readonly VITE_STORAGE_PREFIX?: string;
}
}
interface ImportMeta {
readonly env: Env.ImportMeta;
}

View File

@ -1,27 +1,27 @@
interface Window {
/** NProgress instance */
NProgress?: import('nprogress').NProgress;
/** Loading bar instance */
$loadingBar?: import('naive-ui').LoadingBarProviderInst;
/** Dialog instance */
$dialog?: import('naive-ui').DialogProviderInst;
/** Message instance */
$message?: import('naive-ui').MessageProviderInst;
/** Notification instance */
$notification?: import('naive-ui').NotificationProviderInst;
}
export {};
interface ViewTransition {
ready: Promise<void>;
}
declare global {
export interface Window {
/** NProgress instance */
NProgress?: import('nprogress').NProgress;
/** Loading bar instance */
$loadingBar?: import('naive-ui').LoadingBarProviderInst;
/** Dialog instance */
$dialog?: import('naive-ui').DialogProviderInst;
/** Message instance */
$message?: import('naive-ui').MessageProviderInst;
/** Notification instance */
$notification?: import('naive-ui').NotificationProviderInst;
}
interface Document {
startViewTransition?: (callback: () => Promise<void> | void) => ViewTransition;
}
interface ViewTransition {
ready: Promise<void>;
}
interface ImportMeta {
readonly env: Env.ImportMeta;
}
export interface Document {
startViewTransition?: (callback: () => Promise<void> | void) => ViewTransition;
}
/** Build time of the project */
declare const BUILD_TIME: string;
/** Build time of the project */
export const BUILD_TIME: string;
}