feat(api): 添加 http 工具模块并更新相关文件

- 新增 http 工具模块,用于创建带有基础 URL 的 axios 实例
- 更新 package.json,添加 axios 依赖
- 调整 addClient.js 文件的格式
This commit is contained in:
aixianling
2025-02-25 18:02:16 +08:00
parent 628a6fee80
commit 7ab5d7dbbf
3 changed files with 7 additions and 3 deletions

3
utils/http.js Normal file
View File

@@ -0,0 +1,3 @@
require("dotenv").config();
const { default: axios } = require("axios");
module.exports = (baseURL = process.env.BASE_URL) => axios.create({ baseURL: BASE_URL });