From 5bc29f9200327de1d8aa23ab383bbd7f115db7ee Mon Sep 17 00:00:00 2001 From: pan93412 Date: Sat, 17 Oct 2020 16:15:59 +0200 Subject: [PATCH] feat(utils/request): make configuring baseURL easier --- src/config/request.js | 6 ++++++ src/utils/request.js | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 src/config/request.js diff --git a/src/config/request.js b/src/config/request.js new file mode 100644 index 0000000..bac58ec --- /dev/null +++ b/src/config/request.js @@ -0,0 +1,6 @@ +/** + * The base url of your API. + * + * The API can be found at https://github.com/Binaryify/NeteaseCloudMusicApi + */ +export const baseURL = ""; \ No newline at end of file diff --git a/src/utils/request.js b/src/utils/request.js index 795d218..fb482fd 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -1,7 +1,8 @@ import axios from "axios"; +import { baseURL } from "@/config/request"; const service = axios.create({ - baseURL: "/api", + baseURL: baseURL, withCredentials: true, timeout: 15000, });