From 5dfdc9da10366bbbe6a5c88fc7bb20dda97d1df4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=A5=BF=E7=93=9C=C2=B0?= Date: Tue, 28 Apr 2026 01:42:15 +0800 Subject: [PATCH] dev Co-authored-by: Copilot --- backend/api/routes/info.py | 8 ++--- backend/dataFiles/dcalc_0.db | Bin 860160 -> 860160 bytes frontend/src/api/info/index.ts | 4 +-- .../Character/EquipmentDictionary/Index.vue | 29 +++++++++--------- frontend/src/stores/info.ts | 9 +++--- 5 files changed, 26 insertions(+), 24 deletions(-) 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 0a6e8d8c25314b90a84122274a8f47db87a9bfe3..3b872e05a3f147bb18b60adf872b15e7bb735fa3 100644 GIT binary patch delta 558 zcmY+>PiPZC6bA5_Zg$gbUN=D~i%CsDTQ6x-t;CFQA+X8#gpE=I8|BjI`f*g%Rna){!jluo%X+nrjE41erd`;X+4C_B*?dZ$M zXXO&DJl~ucqRE9JpC;0#Ii48US(+qe%(`$9tF3rO3@*S9itlbiBROC5NvO(F9i0Ie zr|!lx_&R_y*tVe`YYjMToS6I1tu_9-EY=-hVxemNxLlKis4!5=T64=YU>_11wy3J%Y~hLI!D zjlzY4Lyq zrQ25-eB6N?PT4Sq`xfELpEHqf!^1AhQYS?`VzcSBk~6i-q@VjpA1g>(QxE;=TA5Pb$;YR PFBP)m78Munz_s8v|Cptj delta 533 zcmY+AK}Zx~7>56UXJ^)(ecjoD+}br2MM%NiWDf<6xTvhyrA|gr{)bp8kT5q_-FBU+ z{#7UjCG=xYA%zrliHiT~rRWyjGP-yP5u=OeY|I$w_8p%0<^3LKGwW<-m(#qk(mcou zu8@LD5t2faA}ob2g&{>miUuj7QkYW2-V3bXNf}@!tMhQL_R(6idiWlzH#+7<^kQW7 zSgdM2xLmQ)$)s&{o*K+Ei)aoddhH=Ymx{Pf@8*#^Id(rlY-UNju`hEW)0a6%>vL$Q zwhH28mvLTsWjxcujB)Mh_P{~nQJ2eu;4sV4)hWzS&OnNOeMJM^n#Bw1CQQ)pyC_=) zmj!g*r|u6aDBmqql)#}@uW_KQbIGp&>%)b2fO@pyMNV21sNzLYSd#4OHm z>RG^6TN8_TMu)b@n&R!|H^yp{t{w!EEKmIo#_7#Xw5aC}Zfi7NiM6P`DIDj@mYC#p zFbzq)i}-PPwW{nAUWNF`+wFlNE%ET0YXog4{I*dKH~zNKry9O^t?pyR5^v+p3CnJgNNwqcxm_ 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, }