merge: Merge soybean.

This commit is contained in:
xlsea 2025-05-16 16:48:05 +08:00
commit fc68a4d054
8 changed files with 1088 additions and 732 deletions

View File

@ -50,14 +50,14 @@
},
"dependencies": {
"@better-scroll/core": "2.5.1",
"@iconify/vue": "4.3.0",
"@iconify/vue": "5.0.0",
"@sa/axios": "workspace:*",
"@sa/color": "workspace:*",
"@sa/hooks": "workspace:*",
"@sa/materials": "workspace:*",
"@sa/tinymce": "workspace:*",
"@sa/utils": "workspace:*",
"@vueuse/core": "13.0.0",
"@vueuse/core": "13.1.0",
"clipboard": "2.0.11",
"dayjs": "1.11.13",
"defu": "6.1.4",
@ -68,55 +68,52 @@
"monaco-editor": "^0.52.0",
"naive-ui": "2.41.0",
"nprogress": "0.2.0",
"pinia": "3.0.1",
"tailwind-merge": "3.0.2",
"pinia": "3.0.2",
"tailwind-merge": "3.2.0",
"vue": "3.5.13",
"vue-advanced-cropper": "^2.8.9",
"vue-draggable-plus": "0.6.0",
"vue-i18n": "11.1.2",
"vue-router": "4.5.0"
"vue-i18n": "11.1.3",
"vue-router": "4.5.1"
},
"devDependencies": {
"@elegant-router/vue": "0.3.8",
"@iconify/json": "2.2.318",
"@iconify/json": "2.2.337",
"@sa/scripts": "workspace:*",
"@sa/uno-preset": "workspace:*",
"@soybeanjs/eslint-config": "1.6.0",
"@types/node": "22.13.10",
"@types/node": "22.15.17",
"@types/nprogress": "0.2.3",
"@unocss/eslint-config": "66.0.0",
"@unocss/preset-icons": "66.0.0",
"@unocss/preset-uno": "66.0.0",
"@unocss/transformer-directives": "66.0.0",
"@unocss/transformer-variant-group": "66.0.0",
"@unocss/vite": "66.0.0",
"@vitejs/plugin-vue": "5.2.3",
"@unocss/eslint-config": "66.1.1",
"@unocss/preset-icons": "66.1.1",
"@unocss/preset-uno": "66.1.1",
"@unocss/transformer-directives": "66.1.1",
"@unocss/transformer-variant-group": "66.1.1",
"@unocss/vite": "66.1.1",
"@vitejs/plugin-vue": "5.2.4",
"@vitejs/plugin-vue-jsx": "4.1.2",
"consola": "3.4.2",
"eslint": "9.22.0",
"eslint-plugin-vue": "10.0.0",
"eslint": "9.26.0",
"eslint-plugin-vue": "10.1.0",
"kolorist": "1.8.0",
"lint-staged": "15.5.0",
"sass": "1.86.0",
"simple-git-hooks": "2.11.1",
"tsx": "4.19.3",
"typescript": "5.8.2",
"sass": "1.88.0",
"simple-git-hooks": "2.13.0",
"tsx": "4.19.4",
"typescript": "5.8.3",
"unplugin-icons": "22.1.0",
"unplugin-vue-components": "28.4.1",
"vite": "6.2.2",
"unplugin-vue-components": "28.5.0",
"vite": "6.3.5",
"vite-plugin-monaco-editor": "^1.1.0",
"vite-plugin-progress": "0.0.7",
"vite-plugin-static-copy": "^3.0.0",
"vite-plugin-svg-icons": "2.0.1",
"vite-plugin-vue-devtools": "7.7.2",
"vue-eslint-parser": "10.1.1",
"vue-tsc": "2.2.8"
"vite-plugin-vue-devtools": "7.7.6",
"vue-eslint-parser": "10.1.3",
"vue-tsc": "2.2.10"
},
"simple-git-hooks": {
"commit-msg": "pnpm sa git-commit-verify",
"pre-commit": "pnpm typecheck && pnpm lint-staged"
"pre-commit": "pnpm typecheck && pnpm lint && git diff --exit-code"
},
"lint-staged": {
"*": "eslint --fix"
}
"website": "https://ruoyi.xlsea.cn"
}

View File

@ -13,7 +13,7 @@
}
},
"dependencies": {
"@alova/mock": "2.0.12",
"@alova/mock": "2.0.14",
"@sa/utils": "workspace:*",
"alova": "3.2.10"
}

View File

@ -11,7 +11,7 @@
},
"dependencies": {
"@sa/utils": "workspace:*",
"axios": "1.8.3",
"axios": "1.9.0",
"axios-retry": "4.5.0",
"qs": "6.14.0"
},

View File

@ -11,7 +11,7 @@
},
"dependencies": {
"@sa/utils": "workspace:*",
"simplebar-vue": "2.4.0"
"simplebar-vue": "2.4.1"
},
"devDependencies": {
"typed-css-modules": "0.9.1"

View File

@ -15,13 +15,13 @@
"devDependencies": {
"@soybeanjs/changelog": "0.3.24",
"bumpp": "10.1.0",
"c12": "3.0.2",
"c12": "3.0.3",
"cac": "6.7.14",
"consola": "3.4.2",
"enquirer": "2.4.1",
"execa": "9.5.2",
"execa": "9.5.3",
"kolorist": "1.8.0",
"npm-check-updates": "17.1.15",
"npm-check-updates": "18.0.1",
"rimraf": "6.0.1"
}
}

File diff suppressed because it is too large Load Diff

View File

@ -39,6 +39,8 @@ export const useAuthStore = defineStore(SetupStoreId.Auth, () => {
async function resetStore() {
const authStore = useAuthStore();
recordUserId();
clearAuthStorage();
authStore.$reset();
@ -56,6 +58,41 @@ export const useAuthStore = defineStore(SetupStoreId.Auth, () => {
resetStore();
}
/** Record the user ID of the previous login session Used to compare with the current user ID on next login */
function recordUserId() {
if (!userInfo.user?.userId) {
return;
}
// Store current user ID locally for next login comparison
localStg.set('lastLoginUserId', userInfo.user?.userId);
}
/**
* Check if current login user is different from previous login user If different, clear all tabs
*
* @returns {boolean} Whether to clear all tabs
*/
function checkTabClear(): boolean {
if (!userInfo.user?.userId) {
return false;
}
const lastLoginUserId = localStg.get('lastLoginUserId');
// Clear all tabs if current user is different from previous user
if (!lastLoginUserId || lastLoginUserId !== userInfo.user?.userId) {
localStg.remove('globalTabs');
tabStore.clearTabs();
localStg.remove('lastLoginUserId');
return true;
}
localStg.remove('lastLoginUserId');
return false;
}
/**
* Login
*
@ -79,10 +116,19 @@ export const useAuthStore = defineStore(SetupStoreId.Auth, () => {
const pass = await loginByToken(loginToken);
if (pass) {
await redirectFromLogin(redirect);
// Check if the tab needs to be cleared
const isClear = checkTabClear();
let needRedirect = redirect;
if (isClear) {
// If the tab needs to be cleared,it means we don't need to redirect.
needRedirect = false;
}
await redirectFromLogin(needRedirect);
// window.$notification?.success({
// title: $t('page.login.common.loginSuccess'),
// content: $t('page.login.common.welcomeBack', { userName: userInfo.user?.nickName }),
// content: $t('page.login.common.welcomeBack', { userName: userInfo.userName }),
// duration: 4500
// });
}

View File

@ -42,6 +42,8 @@ declare namespace StorageType {
layout: UnionKey.ThemeLayoutMode;
siderCollapse: boolean;
};
/** The last login user id */
lastLoginUserId: CommonType.IdType;
/** The login form rember */
loginRember: Api.Auth.PwdLoginForm;
/** The tenant id */