mirror of
https://github.com/algerkong/AlgerMusicPlayer.git
synced 2026-05-18 03:17:29 +08:00
✨ feat: 解决检查更新请求失败问题
This commit is contained in:
@@ -34,8 +34,16 @@ export interface UpdateResult {
|
||||
*/
|
||||
export const getLatestReleaseInfo = async (): Promise<GithubReleaseInfo | null> => {
|
||||
try {
|
||||
const token = import.meta.env.VITE_GITHUB_TOKEN;
|
||||
const headers = {};
|
||||
if (token) {
|
||||
headers['Authorization'] = `token ${token}`;
|
||||
}
|
||||
const response = await axios.get(
|
||||
'https://api.github.com/repos/algerkong/AlgerMusicPlayer/releases/latest'
|
||||
'https://api.github.com/repos/algerkong/AlgerMusicPlayer/releases/latest',
|
||||
{
|
||||
headers
|
||||
}
|
||||
);
|
||||
|
||||
if (response.data) {
|
||||
|
||||
Reference in New Issue
Block a user