mirror of
https://github.com/qier222/YesPlayMusic.git
synced 2026-04-05 02:16:54 +08:00
Update request.js
This commit is contained in:
@@ -57,8 +57,16 @@ service.interceptors.response.use(
|
||||
},
|
||||
async error => {
|
||||
/** @type {import('axios').AxiosResponse | null} */
|
||||
const response = error.response;
|
||||
const data = response.data;
|
||||
let response;
|
||||
let data;
|
||||
if (error === 'TypeError: baseURL is undefined') {
|
||||
response = error;
|
||||
data = error;
|
||||
console.error("You must set up the baseURL in the service's config");
|
||||
} else if (error.response) {
|
||||
response = error.response;
|
||||
data = response.data;
|
||||
}
|
||||
|
||||
if (
|
||||
response &&
|
||||
|
||||
Reference in New Issue
Block a user