增加mqtt

This commit is contained in:
微微一笑
2025-07-16 11:16:19 +08:00
parent e42d4af3b2
commit 6257f9d84b
1550 changed files with 5264 additions and 116701 deletions

View File

@ -1,10 +1,12 @@
import config from '../config/index.js';
const env = 'development';//production //开发of线上 改这里就行
const BASE = config[env];
const request = (options) => {
console.log("options"+JSON.stringify(options))
console.log("options"+JSON.stringify(options),BASE.BASE_URL)
return new Promise((resolve, reject) => {
// 处理GET请求参数
let url = config.BASE_URL + options.url;
let url = BASE.BASE_URL + options.url;
console.log("url"+url)
if (options.method === 'GET' && options.data) {
// 使用qs序列化参数
const params = Object.keys(options.data)
@ -42,7 +44,7 @@ const request = (options) => {
});
};
// 导出基础URL以便其他地方使用
export const baseURL = config.BASE_URL
export const baseURL = BASE.BASE_URL
export const getToken = () => uni.getStorageSync('token') // 获取token的方法
export const clientid =() => uni.getStorageSync('clientID');
export default request;