index.ts 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. import { defHttp } from '@/config/axios'
  2. import type { SmsTemplateVO, SmsSendVO } from './types'
  3. // 查询短信模板列表
  4. export const getSmsTemplatePageApi = ({ params }) => {
  5. return defHttp.get<PageResult<SmsTemplateVO>>({ url: '/system/sms-template/page', params })
  6. }
  7. // 查询短信模板详情
  8. export const getSmsTemplateApi = (id: number) => {
  9. return defHttp.get<SmsTemplateVO>({ url: '/system/sms-template/get?id=' + id })
  10. }
  11. // 新增短信模板
  12. export const createSmsTemplateApi = (params: SmsTemplateVO) => {
  13. return defHttp.post({ url: '/system/sms-template/create', params })
  14. }
  15. // 修改短信模板
  16. export const updateSmsTemplateApi = (params: SmsTemplateVO) => {
  17. return defHttp.put({ url: '/system/sms-template/update', params })
  18. }
  19. // 删除短信模板
  20. export const deleteSmsTemplateApi = (id: number) => {
  21. return defHttp.delete({ url: '/system/sms-template/delete?id=' + id })
  22. }
  23. // 发送短信
  24. export function sendSms(params: SmsSendVO) {
  25. return defHttp.post({ url: '/system/sms-template/send-sms', params })
  26. }
  27. // 导出短信模板
  28. export const exportPostApi = (params) => {
  29. return defHttp.get({ url: '/system/sms-template/export-excel', params, responseType: 'blob' })
  30. }