Skip to content

Commit 6328ac1

Browse files
committed
修复水鱼开发者api获取问题
1 parent dc58bdf commit 6328ac1

3 files changed

Lines changed: 45 additions & 17 deletions

File tree

web/src/App.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const themeOverrides: GlobalThemeOverrides = {
3232
</main>
3333

3434
<footer>
35-
<p>Powered by MuNET-OSS · <a href="https://github.com/MuNET-OSS/chunithm-data-converter" target="_blank" rel="noopener noreferrer">GitHub</a></p>
35+
<p>Powered by MuNET-OSS · Power By Applesaber · <a href="https://github.com/MuNET-OSS/chunithm-data-converter" target="_blank" rel="noopener noreferrer">GitHub</a></p>
3636
</footer>
3737
</n-dialog-provider>
3838
</n-message-provider>

web/src/utils/api.ts

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,10 @@ const LXNS_BASE_URL = 'https://maimai.lxns.net/api/v0'
55
const SHUIYU_BASE_URL = 'https://www.diving-fish.com/api/chunithmprober'
66

77
async function fetchJson(url: string, headers: Record<string, string>): Promise<unknown> {
8-
let res: Response;
9-
try {
10-
res = await fetch(url, {
11-
method: 'GET',
12-
headers: { ...headers, 'Content-Type': 'application/json' },
13-
})
14-
} catch (e) {
15-
console.warn('Direct fetch failed, falling back to allorigins proxy', e);
16-
const proxyUrl = `https://api.allorigins.win/raw?url=${encodeURIComponent(url)}`;
17-
res = await fetch(proxyUrl, {
18-
method: 'GET',
19-
headers: { ...headers, 'Content-Type': 'application/json' },
20-
});
21-
}
8+
const res = await fetch(url, {
9+
method: 'GET',
10+
headers,
11+
})
2212

2313
if (!res.ok) {
2414
if (res.status === 401) throw new Error('认证失败:请检查令牌是否正确')

web/src/utils/converter.ts

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,40 @@ function createMunetTemplate(username: string): MunetJson {
101101
avatarItem: 0,
102102
avatarFront: 0,
103103
avatarBack: 0,
104+
classEmblemBase: 0,
105+
classEmblemMedal: 0,
106+
stockedGridCount: 0,
107+
exMapLoopCount: 0,
108+
netBattlePlayCount: 0,
109+
netBattleWinCount: 0,
110+
netBattleLoseCount: 0,
111+
netBattleConsecutiveWinCount: 0,
112+
charaIllustId: 0,
113+
skillId: 0,
114+
stageId: 0,
115+
overPowerPoint: 0,
116+
overPowerRate: 0,
117+
overPowerLowerRank: 0,
118+
avatarPoint: 0,
119+
battleRankId: 0,
120+
battleRankPoint: 0,
121+
eliteRankPoint: 0,
122+
netBattle1stCount: 0,
123+
netBattle2ndCount: 0,
124+
netBattle3rdCount: 0,
125+
netBattle4thCount: 0,
126+
netBattleCorrection: 0,
127+
netBattleErrCnt: 0,
128+
netBattleHostErrCnt: 0,
129+
battleRewardStatus: 0,
130+
battleRewardIndex: 0,
131+
battleRewardCount: 0,
132+
ext1: 0, ext2: 0, ext3: 0, ext4: 0, ext5: 0,
133+
ext6: 0, ext7: 0, ext8: 0, ext9: 0, ext10: 0,
134+
extStr1: '', extStr2: '',
135+
extLong1: 0, extLong2: 0,
136+
rankUpChallengeResults: null,
137+
netBattleEndState: 0,
104138
trophyIdSub1: 0,
105139
trophyIdSub2: 0,
106140
banState: 0,
@@ -127,11 +161,12 @@ function createMunetTemplate(username: string): MunetJson {
127161
},
128162
userActivityList: [],
129163
userCharacterList: [],
164+
userChargeList: [],
165+
userCourseList: [],
166+
userDuelList: [],
130167
userItemList: [],
131168
userMapList: [],
132169
userMusicDetailList: [],
133-
userCourseList: [],
134-
userChargeList: [],
135170
userPlaylogList: [],
136171
}
137172
}
@@ -162,8 +197,11 @@ export function convertScoresToMunet(
162197
totalHiScore,
163198
totalScore: totalHiScore,
164199
lastPlayDate: playerInfo.uploadTime,
200+
classEmblemBase: playerInfo.classEmblem?.['base'] ?? 0,
201+
classEmblemMedal: playerInfo.classEmblem?.['medal'] ?? 0,
165202
medal: playerInfo.classEmblem?.['medal'] ?? 0,
166203
mapIconId: playerInfo.mapIcon?.['id'] ?? 0,
204+
charaIllustId: playerInfo.character?.['id'] ?? 0,
167205
overPowerPoint: Math.round(playerInfo.overPower * 100),
168206
overPowerRate: Math.round(playerInfo.overPowerProgress * 100),
169207
})

0 commit comments

Comments
 (0)