diff --git a/backend/api/routes/info.py b/backend/api/routes/info.py index 5f8ab37f..5e546875 100644 --- a/backend/api/routes/info.py +++ b/backend/api/routes/info.py @@ -58,19 +58,19 @@ async def get_character_info(request: Request, state: AltersDep, redis: RedisDep @router.get('/info/oath/{suitId}/{skillId}') -async def get_oath_info(state: AltersDep, suitId: str, skillId: str, rarity: str, redis: RedisDep): +async def get_oath_info(state: AltersDep, suitId: str, skillId: str, rarity: str, lv: int, redis: RedisDep): def get_info(): skill = None version = state.equVersion equ = get_equipment(version) - oath = next((x for x in equ.oath_suits if x.suitId == suitId and x.rarity == rarity), None) + oath = next((x for x in equ.oath_suits if x.suitId == suitId and x.rarity == rarity and str(x.level) == str(lv)), None) if oath is not None: oathSkill = next((x for x in oath.skills if x.skillId == skillId), None) if oathSkill is not None: - skill = {**oathSkill.__dict__, 'point': oath.points, 'imageUrl': oath.imageUrl} + skill = {**oathSkill.__dict__, 'point': oath.points.split(',')[lv - 1], 'imageUrl': oath.imageUrl} return skill - info = get_redis_info(redis, f'dcalc:oath:{suitId}:{rarity}:{skillId}', get_info) + info = get_redis_info(redis, f'dcalc:oath:{suitId}:{rarity}:{lv}:{skillId}', get_info) return response(data=info) diff --git a/backend/dataFiles/dcalc_0.db b/backend/dataFiles/dcalc_0.db index 0a6e8d8c..3b872e05 100644 Binary files a/backend/dataFiles/dcalc_0.db and b/backend/dataFiles/dcalc_0.db differ diff --git a/frontend/src/api/info/index.ts b/frontend/src/api/info/index.ts index 03978e0b..4aa2d21b 100644 --- a/frontend/src/api/info/index.ts +++ b/frontend/src/api/info/index.ts @@ -27,8 +27,8 @@ export default defineRequest((request) => { const res = await request.post(`/skillTree/`, { code }) return res.data }, - async getOathInfo(suitId: string, skillId: string, rarity: string) { - const res = await request.get(`/info/oath/${suitId}/${skillId}`, { params: { rarity } }) + async getOathInfo(suitId: string, skillId: string, rarity: string, lv: number) { + const res = await request.get(`/info/oath/${suitId}/${skillId}`, { params: { rarity, lv } }) return res.data }, } diff --git a/frontend/src/pages/Character/EquipmentDictionary/Index.vue b/frontend/src/pages/Character/EquipmentDictionary/Index.vue index f7af950c..b3e34867 100644 --- a/frontend/src/pages/Character/EquipmentDictionary/Index.vue +++ b/frontend/src/pages/Character/EquipmentDictionary/Index.vue @@ -341,7 +341,7 @@ const curOathInfo = computed(() => { return infoStore.oathSkills?.[curEquInfo.value?.suit[0]] }) -const curOathSkillLvs = asyncComputed(async () => { +const curOathSkillInfo = asyncComputed(async () => { if (!curOathInfo.value || !curEquInfo.value?.suit[0]) { return undefined } @@ -349,23 +349,24 @@ const curOathSkillLvs = asyncComputed(async () => { curEquInfo.value?.suit[0], oathSkillId.value, curOathSkillLv.value.rarity, + curOathSkillLv.value.lv, ) return res }) -const curOathSkillInfo = computed(() => { - const res = curOathSkillLvs.value - if (!res) { - return undefined - } - // console.log(curEquInfo.value?.suit[0]) - return { - ...res, - SkillAttack: parseFloat(res.SkillAttack.toString().split(',')[curOathSkillLv.value.lv - 1]), - Buffer: parseFloat(res.Buffer.toString().split(',')[curOathSkillLv.value.lv - 1]), - point: parseFloat(res.point.toString().split(',')[curOathSkillLv.value.lv - 1]), - } -}) +// const curOathSkillInfo = computed(() => { +// const res = curOathSkillLvs.value +// if (!res) { +// return undefined +// } +// // console.log(curEquInfo.value?.suit[0]) +// return { +// ...res, +// SkillAttack: parseFloat(res.SkillAttack.toString().split(',')[curOathSkillLv.value.lv - 1]), +// Buffer: parseFloat(res.Buffer.toString().split(',')[curOathSkillLv.value.lv - 1]), +// point: parseFloat(res.point.toString().split(',')[curOathSkillLv.value.lv - 1]), +// } +// }) const chooseCategory = (cat: string) => { type.value = cat diff --git a/frontend/src/stores/info.ts b/frontend/src/stores/info.ts index 45d0f757..a78ac5b7 100644 --- a/frontend/src/stores/info.ts +++ b/frontend/src/stores/info.ts @@ -13,6 +13,7 @@ export const useInfoStore = defineStore('infoStore', () => { suitId: string skillId: string rarity: string + lv: number data: ISuit }[] >([]) @@ -54,17 +55,17 @@ export const useInfoStore = defineStore('infoStore', () => { return result }) - const getOathInfo = async (suitId: string, skillId: string, rarity: string) => { + const getOathInfo = async (suitId: string, skillId: string, rarity: string, lv: number) => { const res = oathCache.value.find( - (o) => o.suitId === suitId && o.skillId === skillId && o.rarity === rarity, + (o) => o.suitId === suitId && o.skillId === skillId && o.rarity === rarity && o.lv === lv, ) if (res) { return { ...res.data, } } - const data: ISuit = await api.getOathInfo(suitId, skillId, rarity) - oathCache.value.push({ suitId, skillId, rarity, data }) + const data: ISuit = await api.getOathInfo(suitId, skillId, rarity, lv) + oathCache.value.push({ suitId, skillId, rarity, lv, data }) return { ...data, }