mirror of
https://github.com/certd/certd.git
synced 2026-05-15 12:37:30 +08:00
fix: 修复执行日志没有清理的bug
This commit is contained in:
@@ -5,7 +5,7 @@ import _ from "lodash-es";
|
||||
import { LocalStorage } from "/src/utils/util.storage";
|
||||
|
||||
import * as basicApi from "/@/api/modules/api.basic";
|
||||
import { SysPublicSetting } from "/@/api/modules/api.basic";
|
||||
import { SysInstallInfo, SysPublicSetting } from "/@/api/modules/api.basic";
|
||||
|
||||
export type ThemeToken = {
|
||||
token: {
|
||||
@@ -21,6 +21,9 @@ export interface SettingState {
|
||||
themeConfig?: ThemeConfig;
|
||||
themeToken: ThemeToken;
|
||||
sysPublic?: SysPublicSetting;
|
||||
installInfo?: {
|
||||
siteId: string;
|
||||
};
|
||||
}
|
||||
|
||||
const defaultThemeConfig = {
|
||||
@@ -39,6 +42,9 @@ export const useSettingStore = defineStore({
|
||||
sysPublic: {
|
||||
registerEnabled: false,
|
||||
managerOtherUserPipeline: false
|
||||
},
|
||||
installInfo: {
|
||||
siteId: ""
|
||||
}
|
||||
}),
|
||||
getters: {
|
||||
@@ -47,12 +53,18 @@ export const useSettingStore = defineStore({
|
||||
},
|
||||
getSysPublic(): SysPublicSetting {
|
||||
return this.sysPublic;
|
||||
},
|
||||
getInstallInfo(): SysInstallInfo {
|
||||
return this.installInfo;
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
async loadSysSettings() {
|
||||
const settings = await basicApi.getSysPublicSettings();
|
||||
_.merge(this.sysPublic, settings);
|
||||
|
||||
const installInfo = await basicApi.getInstallInfo();
|
||||
_.merge(this.installInfo, installInfo);
|
||||
},
|
||||
persistThemeConfig() {
|
||||
LocalStorage.set(SETTING_THEME_KEY, this.getThemeConfig);
|
||||
|
||||
@@ -20,7 +20,7 @@ interface UserState {
|
||||
}
|
||||
|
||||
interface PlusInfo {
|
||||
level: number;
|
||||
vipType: string;
|
||||
expireTime: number;
|
||||
isPlus: boolean;
|
||||
}
|
||||
@@ -49,7 +49,7 @@ export const useUserStore = defineStore({
|
||||
return this.getUserInfo?.id === 1;
|
||||
},
|
||||
isPlus(): boolean {
|
||||
return this.plusInfo?.isPlus || false;
|
||||
return this.plusInfo?.isPlus && this.plusInfo?.expireTime > new Date().getTime();
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
|
||||
Reference in New Issue
Block a user