api.js 776 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. import { http } from '@/common/service/service.js'
  2. import configService from '@/common/service/config.service.js';
  3. const apiService = {
  4. /**
  5. * 登录
  6. */
  7. login(params) {
  8. return http.post('/sys/mLogin',params)
  9. },
  10. /**
  11. * 手机号码登录
  12. */
  13. phoneNoLogin(params) {
  14. return http.post('/sys/phoneLogin',params);
  15. },
  16. /**
  17. * 退出
  18. */
  19. logout(params) {
  20. return http.post('/sys/logout',params);
  21. },
  22. /**
  23. * 获取文件访问路径
  24. * @param avatar
  25. * @param subStr
  26. * @returns {*}
  27. */
  28. getFileAccessHttpUrl(avatar,subStr){
  29. if(!subStr) subStr = 'http'
  30. if(avatar && avatar.startsWith(subStr)){
  31. return avatar;
  32. }else{
  33. return configService.staticDomainURL + "/" + avatar;
  34. }
  35. }
  36. };
  37. export default apiService;