businessInfo.ts 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. import httpLogin from "@/api/indexApi";
  2. /**
  3. * @name 商家信息
  4. */
  5. // 营业执照上传
  6. export const getUpload = (params: any) => {
  7. return httpLogin.post(`alienStore/payment/wechatPartner/v3/merchant/media/upload`, params);
  8. };
  9. export const getOcrRequestByBase64 = (params: any) => {
  10. return httpLogin.post(`alienStore/ali/ocrRequestByBase64`, params);
  11. };
  12. /** POST,storeId 走 URL 查询参数,请求体为 JSON */
  13. export const applyment = (data: Record<string, unknown> | object, storeId: string | number) => {
  14. return httpLogin.post(`alienStore/payment/wechatPartner/v3/applyment4sub/applyment`, data, {
  15. params: { storeId },
  16. headers: { "Content-Type": "application/json;charset=UTF-8" }
  17. });
  18. };
  19. /** GET,storeId 为路径参数 */
  20. export const applymentExamine = (storeId: string | number) => {
  21. const id = encodeURIComponent(String(storeId).trim());
  22. return httpLogin.get(`alienStore/payment/wechatPartner/applyment/store/${id}`);
  23. };
  24. export const getPaymentApplyment = (applymentId: string | number) => {
  25. const id = encodeURIComponent(String(applymentId).trim());
  26. return httpLogin.get(`alienStore/payment/wechatPartner/v3/applyment4sub/applyment/applyment_id/${id}`);
  27. };
  28. /** 支付宝直付通图片上传:multipart,字段 image_type + image_content(二进制) */
  29. export interface UploadAlipayImageParams {
  30. /** 图片格式扩展名,3~16 字符,如 jpg、png(支持 bmp、jpg、jpeg、png、gif) */
  31. imageType: string;
  32. /** 图片原始二进制流 */
  33. imageContent: Blob | File;
  34. storeId?: string | number | null;
  35. }
  36. export const uploadAlipayImage = (params: UploadAlipayImageParams, axiosConfig?: object) => {
  37. const fd = new FormData();
  38. const { imageType, imageContent, storeId } = params;
  39. if (storeId !== undefined && storeId !== null && String(storeId).trim() !== "") {
  40. fd.append("storeId", String(storeId));
  41. }
  42. fd.append("imageType", imageType);
  43. fd.append("imageContent", imageContent);
  44. return httpLogin.post(`alienStore/store/alipay/zft/image/upload`, fd, {
  45. encrypt: false,
  46. ...axiosConfig
  47. });
  48. };
  49. export const getAlipayZftCreate = (params: any) => {
  50. return httpLogin.post(`alienStore/store/alipay/zft/create`, params);
  51. };
  52. export const getAlipayExamine = (params: any) => {
  53. return httpLogin.post(`alienStore/store/alipay/zft/order/query`, params);
  54. };