初始化my文件

This commit is contained in:
yziiy
2025-09-26 14:50:30 +08:00
parent 29c69f49fa
commit cae9c4c8fc
1497 changed files with 248229 additions and 0 deletions

25
until/config.js Normal file
View File

@@ -0,0 +1,25 @@
//api 请求路径 本地
// http://md.xscmmidi.site 正式api
// http://tmd.xscmmidi.site 测试api
const BASE_NAME = 'my语聊'
const BASE_URL = "https://my.qixing2.top";
// 前端访问域名
// tmdh.xscmmidi.site 测试
// mdh.xscmmidi.site 正式
const PRIMARY_BGURL = "https://myh5.qixing2.top/image/fy_bg.png";
// 工会管理员
const PRIMARY_BLYURL = "https://myh5.qixing2.top/image/fy_gly.png";
//IM app_key
const IM_APP_TOKEN="67962a777e2b13bc6a4bde3ccd389d1e";
const BASR_COLOR = '#FC7285';
const kefu_url = "https://myh5.qixing2.top/image/kefu.png";
export default {
BASE_URL,
IM_APP_TOKEN,
PRIMARY_BGURL,
PRIMARY_BLYURL,
BASR_COLOR,
BASE_NAME,
kefu_url
}

45
until/http.js Normal file
View File

@@ -0,0 +1,45 @@
// 导入封装好的axios实例
import request from "./request.js";
const http = {
/**
* methods: 请求
* @param url 请求地址
* @param params 请求参数
*/
get(url, params) {
const config = {
method: "get",
url: url,
};
if (params) config.params = params;
return request(config);
},
post(url, params) {
const config = {
method: "post",
url,
}
if (params) config.data = params;
return request(config);
},
put(url, params) {
const config = {
method: "put",
url,
}
if (params) config.params = params;
return request(config);
},
delete(url, params) {
const config = {
method: "delete",
url,
}
if (params) config.params = params;
return request(config);
},
};
export default http;

36
until/request.js Normal file
View File

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