Skip to content

Commit 878f13b

Browse files
committed
feat: 为fetchLatestWinInfos添加特定参数并优化返回结果
1 parent 5268a1e commit 878f13b

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

src/services/api.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -224,10 +224,14 @@ export async function fetchEditionAndLanguageOptions(
224224
*/
225225
export async function fetchLatestWinInfos(): Promise<WinFileInfo[]> {
226226
const [latestInfos11, latestInfos10] = await Promise.all([
227-
fetchWinInfos('11'),
228-
fetchWinInfos('10'),
227+
fetchWinInfos('11', 'latest', 'zh-cn', 'x64', 'Professional'),
228+
fetchWinInfos('10', 'latest', 'zh-cn', 'x64', 'Professional'),
229229
]);
230-
return [...latestInfos11, ...latestInfos10];
230+
231+
const latest11 = latestInfos11[0];
232+
const latest10 = latestInfos10[0];
233+
234+
return [latest11, latest10].filter((item): item is WinFileInfo => Boolean(item));
231235
}
232236

233237
/**

0 commit comments

Comments
 (0)