getApiRes.js 761 B

123456789101112131415161718192021222324252627282930
  1. import axios from 'axios';
  2. import global from '../Global.js'
  3. // 基础方法进行封装
  4. function getApiBasic(url, postdata) {
  5. return axios.post(url, postdata).then(function (data) {
  6. let json = data.data;
  7. return json
  8. }, function (response) {
  9. console.info(response);
  10. })
  11. }
  12. // 调用的api改写成方法
  13. export function getUserList(postdata) {
  14. let url = headapi + 'getUserList';
  15. return getApiBasic(url, postdata);
  16. }
  17. // 上课中学生信息
  18. export function getHello(postdata) {
  19. let url = headapi + 'getUserListInfo';
  20. return getApiBasic(url, postdata);
  21. }
  22. // 是否开始上课的状态
  23. export function getClassStat(postdata) {
  24. let url = headapi + 'getClassStat';
  25. return getApiBasic(url, postdata);
  26. }