Skip to content
文档
生日彩蛋项目
开始修改文件
src目录
api目录
music.js

music.js 文件 指导修改

目录树位置:✅api/music.js 你的api文件夹 下的 music.js 文件

Api更改方法

跳转到第 4 行 更改此处的const BASE_URL = 'https://music.xn--7ovw36h.love';

这是一个音乐Api,您可以自行在Vercel部署这个项目

项目链接:快速直达 (opens in a new tab)

import axios from 'axios';
const MAX_RETRIES = 3;
const RETRY_DELAY = 5000; // 5秒
const BASE_URL = 'https://music.xn--7ovw36h.love';
 
/**
 * 获取音乐 URL - 新式方法
 * @param {string} id - 歌曲 ID
 * @param {string} level - 音质等级,默认为 'exhigh'
 * @returns {Promise} - 返回请求的 Promise 对象
 */
const getMusicUrlNewMethod = (id, level = 'exhigh') => {
  const url = `${BASE_URL}/song/url/v1?id=${id}&level=${level}`;
  return axios.get(url);
};