You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
659 B
JavaScript
22 lines
659 B
JavaScript
import { fetchJSON, postForm, postJSON } from '@/utils/request';
|
|
import { API_HOST, WAI_HOST } from '@/config';
|
|
|
|
export const postSendMsg = async (body) => {
|
|
const { attaList=[], atta, content, ...bodyData } = body;
|
|
const formData = new FormData();
|
|
Object.keys(bodyData).forEach(function (key) {
|
|
formData.append(key, bodyData[key]);
|
|
});
|
|
attaList.forEach(function (item) {
|
|
formData.append('attachment', item);
|
|
});
|
|
const { result } = await postJSON(`${WAI_HOST}/messages/text`, body);
|
|
return result;
|
|
};
|
|
|
|
export const fetchQRCode = (phone) => {
|
|
return fetchJSON(
|
|
`${WAI_HOST}/channels/qrcode`,
|
|
{ phone })
|
|
}
|