dev/voice
Lei OT 7 months ago
parent 4d878d0dc3
commit da5970a5b8

@ -7,14 +7,14 @@ const WAI_API_VER = '/api/v1'
export const postSendMsg = async (body) => { export const postSendMsg = async (body) => {
const { waiServer } = usingStorage(WAI_SERVER_KEY) const { waiServer } = usingStorage(WAI_SERVER_KEY)
const { attaList = [], atta, content, ...bodyData } = body // const { attaList = [], atta, content, ...bodyData } = body
const formData = new FormData() // const formData = new FormData()
Object.keys(bodyData).forEach(function (key) { // Object.keys(bodyData).forEach(function (key) {
formData.append(key, bodyData[key]) // formData.append(key, bodyData[key])
}) // })
attaList.forEach(function (item) { // attaList.forEach(function (item) {
formData.append('attachment', item) // formData.append('attachment', item)
}) // })
const { result } = await postJSON(`${waiServer}${WAI_API_VER}/messages/send`, body) const { result } = await postJSON(`${waiServer}${WAI_API_VER}/messages/send`, body)
return result return result
} }

Loading…
Cancel
Save