fix: 修复商业版退出登录后,丢失站点个性化设置的bug

v2-dev
xiaojunnuo 2025-09-08 14:29:15 +08:00
parent 4f39cb8dfa
commit d75dd058d6
2 changed files with 5 additions and 0 deletions

View File

@ -12,6 +12,7 @@ import { utils } from "/@/utils";
import { cloneDeep, merge } from "lodash-es"; import { cloneDeep, merge } from "lodash-es";
import { useI18n } from "/src/locales"; import { useI18n } from "/src/locales";
export interface SettingState { export interface SettingState {
skipReset?: boolean; // 注销登录时不清空此store的状态
sysPublic?: SysPublicSetting; sysPublic?: SysPublicSetting;
installInfo?: { installInfo?: {
siteId: string; siteId: string;
@ -64,6 +65,7 @@ const defaultSiteInfo: SiteInfo = {
export const useSettingStore = defineStore({ export const useSettingStore = defineStore({
id: "app.setting", id: "app.setting",
state: (): SettingState => ({ state: (): SettingState => ({
skipReset: true,
plusInfo: { plusInfo: {
isPlus: false, isPlus: false,
vipType: "free", vipType: "free",

View File

@ -38,6 +38,9 @@ export function resetAllStores() {
} }
const allStores = (pinia as any)._s; const allStores = (pinia as any)._s;
for (const [_key, store] of allStores) { for (const [_key, store] of allStores) {
if (store.skipReset) {
continue;
}
store.$reset(); store.$reset();
} }
} }