mirror of
https://github.com/algerkong/AlgerMusicPlayer.git
synced 2026-04-23 23:57:22 +08:00
✨ feat: 更新依赖和配置,增强开发体验
- 在 electron.vite.config.ts 中启用 Vue DevTools 插件 - 更新 package.json 中多个依赖版本,确保兼容性和性能 - 调整 tsconfig.node.json 的配置,优化模块解析 - 删除不再使用的组件 PlaylistType.vue、RecommendAlbum.vue、RecommendSinger.vue 和 RecommendSonglist.vue - 在请求处理逻辑中改进错误日志输出,使用 console.error 替代 console.log - 在首页视图中替换推荐歌手组件为顶部横幅组件 这些更改旨在提升开发效率和用户体验,确保项目的稳定性和可维护性。
This commit is contained in:
@@ -75,7 +75,7 @@ request.interceptors.response.use(
|
||||
return response;
|
||||
},
|
||||
async (error) => {
|
||||
console.log('error', error);
|
||||
console.error('error', error);
|
||||
const config = error.config as CustomAxiosRequestConfig;
|
||||
|
||||
// 如果没有配置,直接返回错误
|
||||
@@ -84,10 +84,10 @@ request.interceptors.response.use(
|
||||
}
|
||||
|
||||
// 处理 301 状态码
|
||||
if (error.response?.status === 301) {
|
||||
if (error.response?.status === 301 && config.params.noLogin !== true) {
|
||||
// 使用 store mutation 清除用户信息
|
||||
store.commit('logout');
|
||||
console.log(`301 状态码,清除登录信息后重试第 ${config.retryCount} 次`);
|
||||
console.error(`301 状态码,清除登录信息后重试第 ${config.retryCount} 次`, config);
|
||||
config.retryCount = 3;
|
||||
}
|
||||
|
||||
@@ -98,7 +98,7 @@ request.interceptors.response.use(
|
||||
!NO_RETRY_URLS.includes(config.url as string)
|
||||
) {
|
||||
config.retryCount++;
|
||||
console.log(`请求重试第 ${config.retryCount} 次`);
|
||||
console.error(`请求重试第 ${config.retryCount} 次`);
|
||||
|
||||
// 延迟重试
|
||||
await new Promise((resolve) => setTimeout(resolve, RETRY_DELAY));
|
||||
@@ -107,7 +107,7 @@ request.interceptors.response.use(
|
||||
return request(config);
|
||||
}
|
||||
|
||||
console.log(`重试${MAX_RETRIES}次后仍然失败`);
|
||||
console.error(`重试${MAX_RETRIES}次后仍然失败`);
|
||||
return Promise.reject(error);
|
||||
}
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user