From 84613dcf8a0df73cf29936eafa4bbe1c17357e29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=98=AF=E8=99=B9=E5=B7=9D=E8=82=89?= Date: Tue, 5 Mar 2024 18:45:29 +0800 Subject: [PATCH 1/2] Update build.yaml --- .github/workflows/build.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 8a103f3b17..4caf481cf8 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -81,6 +81,7 @@ jobs: - name: Build/release Electron app uses: samuelmeuli/action-electron-builder@v1.6.0 env: + VUE_APP_NETEASE_API_URL: /api VUE_APP_ELECTRON_API_URL: /api VUE_APP_ELECTRON_API_URL_DEV: http://127.0.0.1:10754 VUE_APP_LASTFM_API_KEY: 09c55292403d961aa517ff7f5e8a3d9c From da8afc12cf722c9e9b3e8280754617b3e653e23d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=98=AF=E8=99=B9=E5=B7=9D=E8=82=89?= Date: Tue, 5 Mar 2024 19:00:27 +0800 Subject: [PATCH 2/2] Update request.js --- src/utils/request.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/utils/request.js b/src/utils/request.js index 52ac6f461c..7d72041270 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -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 &&