mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2025-12-12 09:18:14 +08:00
✨ propMap缓存
This commit is contained in:
@@ -61,6 +61,7 @@ async function tryGetDetail(): Promise<void> {
|
|||||||
}
|
}
|
||||||
console.log(res);
|
console.log(res);
|
||||||
showSnackbar({ text: "获取成功!", color: "success" });
|
showSnackbar({ text: "获取成功!", color: "success" });
|
||||||
|
userStore.propMap = res.property_map;
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<style lang="css" scoped>
|
<style lang="css" scoped>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/**
|
/**
|
||||||
* @file store/modules/user.ts
|
* @file store/modules/user.ts
|
||||||
* @description 用户信息模块
|
* @description 用户信息模块
|
||||||
* @since Beta v0.5.1
|
* @since Beta v0.5.3
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { defineStore } from "pinia";
|
import { defineStore } from "pinia";
|
||||||
@@ -27,6 +27,7 @@ export const useUserStore = defineStore(
|
|||||||
regionName: "",
|
regionName: "",
|
||||||
});
|
});
|
||||||
const cookie = ref<TGApp.User.Account.Cookie>();
|
const cookie = ref<TGApp.User.Account.Cookie>();
|
||||||
|
const propMap = ref<TGApp.Game.Avatar.PropMap>();
|
||||||
|
|
||||||
function getAllCookie(): string {
|
function getAllCookie(): string {
|
||||||
let res = "";
|
let res = "";
|
||||||
@@ -59,6 +60,7 @@ export const useUserStore = defineStore(
|
|||||||
cookie,
|
cookie,
|
||||||
briefInfo,
|
briefInfo,
|
||||||
account,
|
account,
|
||||||
|
propMap,
|
||||||
getAllCookie,
|
getAllCookie,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
@@ -79,6 +81,11 @@ export const useUserStore = defineStore(
|
|||||||
storage: window.localStorage,
|
storage: window.localStorage,
|
||||||
paths: ["account"],
|
paths: ["account"],
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
key: "propMap",
|
||||||
|
storage: window.localStorage,
|
||||||
|
paths: ["propMap"],
|
||||||
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|||||||
4
src/types/Game/Avatar.d.ts
vendored
4
src/types/Game/Avatar.d.ts
vendored
@@ -98,7 +98,7 @@ declare namespace TGApp.Game.Avatar {
|
|||||||
* @interface AvatarDetail
|
* @interface AvatarDetail
|
||||||
* @since Beta v0.5.3
|
* @since Beta v0.5.3
|
||||||
* @property {DetailList[]} list - 角色详情列表
|
* @property {DetailList[]} list - 角色详情列表
|
||||||
* @property {PropMap[]} property_map - 角色属性映射
|
* @property {PropMap} property_map - 角色属性映射
|
||||||
* @property {PropRecommend} relic_property_options - 圣遗物属性选项
|
* @property {PropRecommend} relic_property_options - 圣遗物属性选项
|
||||||
* @property {Record<string, string>} relic_wiki - 圣遗物属性对应的百科
|
* @property {Record<string, string>} relic_wiki - 圣遗物属性对应的百科
|
||||||
* @property {Record<string, string>} weapon_wiki - 武器属性对应的百科
|
* @property {Record<string, string>} weapon_wiki - 武器属性对应的百科
|
||||||
@@ -107,7 +107,7 @@ declare namespace TGApp.Game.Avatar {
|
|||||||
*/
|
*/
|
||||||
interface AvatarDetail {
|
interface AvatarDetail {
|
||||||
list: DetailList[];
|
list: DetailList[];
|
||||||
property_map: PropMap[];
|
property_map: PropMap;
|
||||||
relic_property_options: PropRecommend;
|
relic_property_options: PropRecommend;
|
||||||
relic_wiki: Record<string, string>;
|
relic_wiki: Record<string, string>;
|
||||||
weapon_wiki: Record<string, string>;
|
weapon_wiki: Record<string, string>;
|
||||||
|
|||||||
Reference in New Issue
Block a user