fix: 聊天(已实现发送文本消息,接收未实现)

This commit is contained in:
2025-07-19 16:04:43 +08:00
parent 1d0c89ac16
commit 86d7f5b21c
16 changed files with 2349 additions and 348 deletions

View File

@@ -3,4 +3,15 @@ import http from './request'
// export async function sendMsg(params) {
// let data = await http('/v1/im/message-send', params)
// return data
// }
// }
// 登录 手机号授权
export async function sendToUserApi(params) {
return await http('/imApi/send-to-user', {
method: 'POST',
data: params,
// 传输方式是json
headers: {
'Content-Type': 'application/json'
}
}, 1)
}

View File

@@ -18,14 +18,18 @@ const sensitiveData = [
'idcard'
]
function request(url, params) {
let baseURL = "https://app.xiaokang88.com/member"
// let baseURL = "http://www.xk888.com/member"
function request(url, params, method = 0) {
// let baseURL = "https://app.xiaokang88.com/member"
let baseURL = "http://127.0.0.1:18000/member"
if (url.split('/').indexOf('imApi') !== -1) {
baseURL = "http://127.0.0.1:12080/api"
}
if (url.split('/').indexOf('newApi') !== -1) {
baseURL = "https://shop.xiaokang88.com/member"
}
url = url.replace('/oldApi', '');
url = url.replace('/newApi', '');
url = url.replace('/imApi', '');
// 加密
if (params != null) {
@@ -44,7 +48,7 @@ function request(url, params) {
// 请求头
header: {
"authorization": 'Bearer ' + uni.getStorageSync("token"),
"Content-Type": "application/x-www-form-urlencoded"
"Content-Type": method === 0? "application/x-www-form-urlencoded": 'application/json'
},
// 成功钩子