Skip to content

Commit

Permalink
fix: 部署一言服务, 将原接口地址更换为稳定的一言接口地址
Browse files Browse the repository at this point in the history
  • Loading branch information
hacxy committed Mar 26, 2024
1 parent 005d368 commit a6bfbe5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/oh-my-live2d/src/utils/index.ts
Expand Up @@ -105,14 +105,14 @@ export const checkVersion = async (): Promise<void> => {

// 获取每日一言
export const getWordTheDay = async (format?: (wordTheDayData: WordTheDayData) => string): Promise<string> => {
const fetchResult = await fetch('https://v1.hitokoto.cn/');
const data = <{ hitokoto: string; from: string }>await fetchResult.json();
const fetchResult = await fetch('https://hitokoto.oml2d.com/');
const data = <WordTheDayData>await fetchResult.json();

if (format) {
return format(data as WordTheDayData);
return format(data as unknown as WordTheDayData);
}

return `${data.hitokoto} -- ${data.from}`;
return `${data.hitokoto} -- ${data.from_who}`;
};

// 窗口大小的媒体查询
Expand Down

0 comments on commit a6bfbe5

Please sign in to comment.