更新羽声语音h5

This commit is contained in:
yziiy
2025-10-23 16:04:28 +08:00
parent f77801f9a1
commit 4fc72fbffe
228 changed files with 5384 additions and 4065 deletions

View File

@@ -1,15 +1,29 @@
//api 请求路径 本地
// http://chat.qxmier.com
// http://vschat.qxmier.com
const BASE_URL="http://chat.qxmier.com";
//api 请求路径 测试
// const BASE_URL="https://h5.qxcms.com/api";
// http://md.xscmmidi.site 正式api
// http://tmd.xscmmidi.site 测试api
const BASE_NAME = '羽声语音'
const BASE_URL = "https://vespa.qxyushen.top";
// 前端访问域名
// tmdh.xscmmidi.site 测试
// mdh.xscmmidi.site 正式
const PRIMARY_BGURL = "https://vespa.qxyushen.top/h5/image/fy_bg.jpg";
// 工会管理员
const PRIMARY_BLYURL = "https://vespa.qxyushen.top/h5/image/fy_gly.png";
const wealth_url = "https://vespa.qxyushen.top/h5/image/wealth.png";
const charm_url = "https://vespa.qxyushen.top/h5/image/charm.png";
const kefu_url = "https://vespa.qxyushen.top/h5/image/kefu.png";
//IM app_key
const IM_APP_TOKEN="67962a777e2b13bc6a4bde3ccd389d1e";
export {
const BASR_COLOR = '#6C49E4';
export default {
BASE_URL,
IM_APP_TOKEN
IM_APP_TOKEN,
PRIMARY_BGURL,
PRIMARY_BLYURL,
BASR_COLOR,
BASE_NAME,
wealth_url,
charm_url,
kefu_url
}

View File

@@ -1,35 +1,53 @@
// src/utils/http.js
import axios from 'axios';
// 创建axios实例
const http = axios.create({
baseURL: 'https://chat.qxmier.com', // API的基础路径
timeout: 5000 // 请求超时时间
import config from './config.js';
const http = (options = {}) => {
console.log(options)
// 请求拦截器逻辑
const requestConfig = {
url: config.BASE_URL + options.url, // 拼接完整请求路径 :cite[1]:cite[2]:cite[7]
method: options.method || 'GET',
data: options.params || options.data || {},
header: { // 注意key 由 axios 的 `headers` 改为 uni.request 的 `header` :cite[1]
'Content-Type': 'application/json', // 明确设置 Content-Type因为 uni.request 默认可能使用 'application/x-www-form-urlencoded' :cite[1]
...options.header, // 合并自定义请求头
},
timeout: options.timeout || 5000,
sslVerify: false
};
// 在发送请求前可以执行的操作,例如添加 token :cite[1]:cite[7]:cite[8]
// 示例:添加 Token
const token = uni.getStorageSync('token');
if (token) {
requestConfig.header['Authorization'] = `${token}`; // 或根据你的后端要求调整
}
return new Promise((resolve, reject) => {
uni.request({
...requestConfig,
success: (response) => {
// 响应拦截器逻辑:对响应数据做点什么
// 这里根据你的业务需求调整,例如直接返回 data :cite[1]:cite[8]
resolve(response.data); // 注意uni.request 的响应结构 response.data 才是服务端返回的数据体 :cite[1]
},
fail: (error) => {
// 响应错误处理
reject(error);
}
});
});
};
// (可选)为方便使用,可以为不同的 HTTP 方法创建快捷方法 :cite[7]
['get', 'post', 'put', 'delete'].forEach((method) => {
http[method] = (url, data, options = {}) => {
return http({
url,
method: method.toUpperCase(),
data,
...options
});
};
});
// 请求拦截器
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;