新增誓约一键导入

This commit is contained in:
2026-05-24 23:57:07 +08:00
parent 7c5488ff24
commit b2e27535fb
5 changed files with 18 additions and 8 deletions
+7 -7
View File
@@ -124,13 +124,13 @@ async def get_dnfhelper_list(uid: str, redis: RedisDep):
@router.get('/dnfhelper/{uid}/')
async def get_info_by_dnfhelper(uid: str, state: AltersDep, redis: RedisDep):
try:
result = await get_user_info_by_id(uid, state)
return response(data=result)
except Exception as e:
if isinstance(e, ResponseException):
return response(code=500, message=str(e), data=None)
return response(code=500, message='Failed to fetch DNFHelper info', data=None)
# try:
result = await get_user_info_by_id(uid, state)
return response(data=result)
# except Exception as e:
# if isinstance(e, ResponseException):
# return response(code=500, message=str(e), data=None)
return response(code=500, message='Failed to fetch DNFHelper info', data=None)
@router.post('/skillTree/')
+9
View File
@@ -108,6 +108,7 @@ def trans_to_dcalc_set(detail, alter: AltersDep):
equips = {}
avatar = {}
emblems = {}
oaths = {}
for equ in detail.get('equs', []):
info = {
'id': '0',
@@ -185,6 +186,13 @@ def trans_to_dcalc_set(detail, alter: AltersDep):
# info['emblem_0'] = emblems[0] if len(emblems) > 0 else 0
# info['emblem_1'] = emblems[1] if len(emblems) > 1 else 0
avatar[item['posName']] = info
for index, item in enumerate(detail.get('oaths', [])):
info = {'id': -1, 'adaptation': 0}
dcalcOath = next((i for i in basic.oaths if i.name == item), None)
if dcalcOath:
info['id'] = dcalcOath.id
info['adaptation'] = 3 if index < 11 else 0
oaths[str(index)] = info
rarities = ['稀有', '神器', '传说', '史诗']
for item in detail.get('emblems', []):
@@ -203,6 +211,7 @@ def trans_to_dcalc_set(detail, alter: AltersDep):
'emblems': emblems,
'avatarLink': detail.get('avatarLink', ''),
'fogOathLv': detail.get('fogOathLv', 0),
'oaths': oaths,
'dressInfo': [
{
'dress': i.get('name', ''),
Binary file not shown.
@@ -19,6 +19,7 @@ export default defineComponent({
configStore.config.avatarLink = res.avatarLink
configStore.config.emblems = res.emblems
configStore.config.sundry.fog = res.fogOathLv
configStore.config.oaths = res.oaths
const { alert } = useDialog()
visible.value = false
await alert({