mirror of
https://github.com/algerkong/AlgerMusicPlayer.git
synced 2026-04-23 23:57:22 +08:00
✨ feat: 解决检查更新请求失败问题
This commit is contained in:
@@ -129,7 +129,7 @@ const handleUpdate = async () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (downloadUrl) {
|
if (downloadUrl) {
|
||||||
window.open(downloadUrl, '_blank');
|
window.open(`https://ghproxy.cn/${downloadUrl}`, '_blank');
|
||||||
} else {
|
} else {
|
||||||
// 如果没有找到对应的安装包,跳转到 release 页面
|
// 如果没有找到对应的安装包,跳转到 release 页面
|
||||||
window.open('https://github.com/algerkong/AlgerMusicPlayer/releases/latest', '_blank');
|
window.open('https://github.com/algerkong/AlgerMusicPlayer/releases/latest', '_blank');
|
||||||
|
|||||||
@@ -34,8 +34,16 @@ export interface UpdateResult {
|
|||||||
*/
|
*/
|
||||||
export const getLatestReleaseInfo = async (): Promise<GithubReleaseInfo | null> => {
|
export const getLatestReleaseInfo = async (): Promise<GithubReleaseInfo | null> => {
|
||||||
try {
|
try {
|
||||||
|
const token = import.meta.env.VITE_GITHUB_TOKEN;
|
||||||
|
const headers = {};
|
||||||
|
if (token) {
|
||||||
|
headers['Authorization'] = `token ${token}`;
|
||||||
|
}
|
||||||
const response = await axios.get(
|
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) {
|
if (response.data) {
|
||||||
|
|||||||
Reference in New Issue
Block a user