存储分区信息

This commit is contained in:
目棃
2025-03-28 11:57:48 +08:00
parent 1d8e7ec35d
commit 3bd1853008
12 changed files with 135 additions and 114 deletions

View File

@@ -1,7 +1,7 @@
/**
* @file store/modules/app.ts
* @description App store module
* @since Beta v0.7.2
* @since Beta v0.7.3
*/
import { path } from "@tauri-apps/api";
@@ -131,13 +131,9 @@ export const useAppStore = defineStore(
"shareDefaultFile",
"imageQualityPercent",
"incognito",
"sidebar",
],
},
{
key: "sidebar",
storage: window.localStorage,
pick: ["sidebar"],
},
{
key: "theme",
storage: window.localStorage,

27
src/store/modules/bbs.ts Normal file
View File

@@ -0,0 +1,27 @@
/**
* @file store/modules/bbs.ts
* @description BBS 模块状态管理
* @since Beta v0.7.3
*/
import { defineStore } from "pinia";
import { shallowRef } from "vue";
import apiHubReq from "@/web/request/apiHubReq.js";
const useBBSStore = defineStore(
"bbs",
() => {
// 游戏列表
const gameList = shallowRef<Array<TGApp.BBS.Game.Item>>([]);
// 刷新游戏列表
async function refreshGameList(): Promise<void> {
gameList.value = await apiHubReq.game();
}
return { gameList, refreshGameList };
},
{ persist: true },
);
export default useBBSStore;