更新正式环境部署

This commit is contained in:
yziiy
2025-09-02 16:28:18 +08:00
parent 5c96e5bd86
commit 2e2da5fc09
13 changed files with 130 additions and 2662 deletions

View File

@@ -1,36 +1,36 @@
// src/utils/http.js
import axios from 'axios';
// const {BASE_URL} from "@/until/config.js";
import config from './config.js';
// 创建axios实例
const http = axios.create({
baseURL: "http://chat.qxmier.com", // API的基础路径
timeout: 5000 // 请求超时时间
baseURL: config.BASE_URL, // API的基础路径
timeout: 5000 // 请求超时时间
});
// 请求拦截器
http.interceptors.request.use(
config => {
// 在发送请求之前做些什么例如添加token等
// config.headers['token'] = `${uni.getStorageSync('token')?? ''}`;
return config;
},
error => {
// 对请求错误做些什么
config => {
// 在发送请求之前做些什么例如添加token等
// config.headers['token'] = `${uni.getStorageSync('token')?? ''}`;
return config;
},
error => {
// 对请求错误做些什么
return Promise.reject(error);
}
return Promise.reject(error);
}
);
// 响应拦截器
http.interceptors.response.use(
response => {
// 对响应数据做点什么
return response.data; // 根据实际情况可能需要返回response.data或其他处理后的数据
},
error => {
// 对响应错误做点什么
return Promise.reject(error);
}
response => {
// 对响应数据做点什么
return response.data; // 根据实际情况可能需要返回response.data或其他处理后的数据
},
error => {
// 对响应错误做点什么
return Promise.reject(error);
}
);
export default http;