index.js 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. const {
  2. http
  3. } = uni.$u
  4. export const buildPic = (params, config = {}) => http.post('/api/buildPicTrue', params, config)
  5. export const getImage = (params, config = {}) => http.post('/api/getImage', params, config)
  6. // 微信授权登陆
  7. export const wxAuthLoginReq = (params, config = {}) => http.post('/api/auth/mnplogin', params, config)
  8. // export const pushFile = (params, config = {}) => http.post('/api/checkAndUploadImg', params, config)
  9. // 创建任务
  10. export const createTask = (params, config = {}) => http.post('/api/createTask', params, config)
  11. // 任务列表
  12. export const taskList = (params, config = {}) => http.get('/api/getTaskList', params, config)
  13. export const getUserInfo = (params, config = {}) => http.get('/api/getUserInfo', params, config)
  14. // 获取AI模型
  15. // export const getAiModal = (params, config = {}) => http.get('/api/getUserInfo', params, config)
  16. // export const getAiModel = (params, config = {}) => http.get('/api/getAiModel', params, config)
  17. export const getAiModel = (params, config = {}) => {
  18. let apiUrl = '/api/getAiModel'
  19. Object.keys(params).forEach((item, index) => {
  20. if (index == 0) {
  21. apiUrl += `?${item}=${params[item]}`
  22. } else {
  23. apiUrl += `&${item}=${params[item]}`
  24. }
  25. })
  26. console.log('处理后的apiUrl', apiUrl);
  27. return http.get(apiUrl, params, config)
  28. }