mirror of
https://github.com/GiriNeko/YesPlayMusic.git
synced 2025-12-16 05:08:04 +00:00
Update request.js
This commit is contained in:
parent
84613dcf8a
commit
da8afc12cf
1 changed files with 10 additions and 2 deletions
|
|
@ -57,8 +57,16 @@ service.interceptors.response.use(
|
||||||
},
|
},
|
||||||
async error => {
|
async error => {
|
||||||
/** @type {import('axios').AxiosResponse | null} */
|
/** @type {import('axios').AxiosResponse | null} */
|
||||||
const response = error.response;
|
let response;
|
||||||
const data = response.data;
|
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 (
|
if (
|
||||||
response &&
|
response &&
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue