api.ts 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. import http from '@/utils/http';
  2. // export function getUserInfo() {
  3. // return http.get('/user/info');
  4. // }
  5. // export function login(data: { username: string; password: string }) {
  6. // return http.post('/auth/login', data);
  7. // }
  8. interface AnalysisKeyword {
  9. productName: string;
  10. locationName: string;
  11. }
  12. interface AnalysisRival {
  13. competitorWebsite: string;
  14. locationName: string;
  15. }
  16. interface GenerateRecord {
  17. phone: string;
  18. companyName: string;
  19. verifyCode: string;
  20. }
  21. interface SavePdf {
  22. phone: string;
  23. id: string;
  24. pdfUrl: string;
  25. }
  26. export const analysisKeyword = (payload: AnalysisKeyword) =>
  27. http.post('/analysis/keyword', payload);
  28. //推荐
  29. export const analysisSuggestions = (payload: AnalysisKeyword) =>
  30. http.post('/analysis/suggestions', payload);
  31. // 竞品
  32. export const analysisRival = (payload: AnalysisRival) => http.post('/analysis/rival', payload);
  33. // 定性分析接口
  34. export const analysisQualitative = (payload: string) =>
  35. http.get(`/analysis/qualitative?keyword=${payload}`);
  36. // 获取验证码
  37. export const verificationCode = (phone: string) =>
  38. http.get(`v3/msg/front/commons/sendSmsCode?phone=${phone}`);
  39. // 生成报告
  40. export const getRecord = (payload: GenerateRecord) => http.post('/analysis/record', payload);
  41. // 更新pdf
  42. export const savePdf = (payload: SavePdf) => http.post('/analysis/savePdf', payload);