mirror of
https://github.com/certd/certd.git
synced 2026-04-24 12:27:25 +08:00
fix: 修复商业版退出登录后,丢失站点个性化设置的bug
This commit is contained in:
@@ -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",
|
||||||
|
|||||||
@@ -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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user